How do I create a jar file, which includes xml and html files?

后端 未结 5 981
猫巷女王i
猫巷女王i 2021-01-14 17:54

I am trying to create a jar file which includes some class and java files needed, but I also would like to include some extra xml, xsl, html, txt (README) files.

I a

5条回答
  •  一整个雨季
    2021-01-14 18:28

    If you move to an ANT (or Maven, for you Maven fans) then you can automate the Jar building very nicely, and also use it outside of Eclipse (e.g., in an automated build environment). All you need to do is copy the files from your src, jsp, foobar and resources locations into a build staging folder, then Jar the resulting files using ANT's Jar task.

    
    
        
    
    
    

    One thing I look down on is including non-source (except package.html files for Javadoc) within the src folder. If you feel you have to do this to achieve something, then you are doing it wrong.

提交回复
热议问题