0

I am willing to using ant build my java project.

I have some .java file in folder resources:

resources
   --sample1.java
   --sample2.java
   --other resources...
src
  --mycode.java

sample1.java and sample2.java are just resources like png,jpg.

Here is my problem: how can I package them into the output jar package without compile the two files?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Dragon
  • 487
  • 4
  • 17
  • Please show your build.xml content.. Your question is opposite of what is discussed in http://stackoverflow.com/questions/804150/ant-compile-doesnt-copy-the-resources, but worth checking. – Jayan May 19 '16 at 02:33
  • Why? Why would you ship source code with your application? – user207421 May 19 '16 at 04:02

1 Answers1

0

By default, when a file with java is created, it is compiled to class file(Assuming you are using some IDE.) So, packaging without compiling your java files seems to be not possible. But, you can try something like this..

<copy todir="your_dir"> <fileset dir="com/main/src/resources"/> </copy>

Ranganath Iyengar
  • 55
  • 1
  • 2
  • 12