adding non-code resources to jar file using Ant

前端 未结 1 764
温柔的废话
温柔的废话 2020-12-01 18:24

I am in the process of packaging my java application into a jar file. I am using ant and eclipse. I need to actually include in the jar a couple of separate, non-code files

1条回答
  •  情深已故
    2020-12-01 18:38

    You shouldn't have an includesfile attribute in a target to start with, and I suspect you've misunderstood the point of it anyway - the idea is that the file you specify with includesfile contains patterns for which files to include, if you don't want to put them into your Ant file.

    It strikes me that all you need is an extra fileset containing the appropriate files you need. For example, for readthis.txt:

    
      
        
        
        
      
    
    

    I would also suggest that you create a new directory for the resources, so you can do:

    
      
        
        
        
      
    
    

    with no hassle. This will also keep your directory structure cleaner, making it easier to find things from the top downwards.

    0 讨论(0)
提交回复
热议问题