2
votes

I am trying to create a jar using the Intellij Generated Ant Build.

  • I am using Intellij 12.1.4
  • I am using Java 1.6.0_51 (Default on Mac).

When I create the ant build I am using the following options:

  • Generate single-file ant build
  • Overwrite previously generated files
  • Use JDK definitions from project files
  • Inline runtime classpaths

I then run the following command on my command line

ant -f buildfile.xml

It looks like it works on the command line. There are a few notes, but no errors. When it finishes it says BUILD SUCCESSFUL. However a .jar is never created.

I found this link: Ant build doesn't make jar file which seems to be my problem. However, I can't seem to figure out how to create a "release" build file from Intellij. I copied my current ant build file and renamed it "build.xml" and ran the command ant release. When I ran that command I got the following error:

BUILD FAILED Target "release" does not exist in the project "MyProject"

Any further help or ideas for next steps would be great.

1

1 Answers

4
votes

I was able to figure it out.

I had to go to open the Project Settings (F4) and then went to Artifacts. That allowed me to set the settings to create the jar when I ran "ant -f buildfile.xml"