Copying data files upon build in Java/Eclipse

前端 未结 3 1553
庸人自扰
庸人自扰 2020-12-17 18:00

Along with my java source, I have some data files that I would like to copy to the build dir when the source is build. Currently I am not using any build tools (e.g. maven o

3条回答
  •  余生分开走
    2020-12-17 18:26

    Go with Ant. To be honest this is the best solution for automation of app building process.

    I am not using Eclipse often. But I bet there must be a build file (build.xml) where you can add something like the code below to it and have it always executed when building your app.

    This is how I am doing it in my build file for one of my projects. I am copying here two folders with all their content to a dist (which in NetBeans serves as a distribution folder where application jar is being created), so then I can easily run my application externally outside the IDE.

    Be aware that the target name in Eclipse might differ. But you should find a correct one described in the build file probably.

     
    
    
        
            
            
    
            
                
            
            
    
            
                
            
            
        
    
     

    All the best, Boro.

提交回复
热议问题