tags:

views:

27

answers:

1

I am trying to create a runnable jar from an Eclipse project.

If I use the new "export runnable jar", as far as I can see there's no way to exclude specific files. (I have a properties file that I am using for testing but that I don't want included in the production jar because I want the user to provide his own properties file.)

On the other hand, if I use the "regular" export jar, it doesn't include any referenced libraries. (I need a JDBC driver jar.) I tried marking the library for export on the build path, but that made no apparent difference.

Is there any way to get the "export runnable jar" to exclude a file, or to get the regular export jar to include a library?

+1  A: 

The best approach to do builds for different environments is to use ANT. You can then have a properties file control different aspects of your environment.

Romain Hippeau
+1. In the export menu select save as ANT file. You can then edit the ANT file with "excludes" and resuse it.
Silence
Hmm, but I don't have different property files for different environments. I want the user to supply the property file. So I just want to do the export, excluding the propety file I'm using for testing.
Jay
@Jay - Just have ANT exclude the file you don't want. When packaging and deploying it is always best to not have a manual process to be consistent and avoid human error.
Romain Hippeau