Exporting dependencies doesn't work altough checked

Hallo everyone!

I have a project that depends on a hand full of other libraries which I added in Module Settings / Modules / Dependencies.
I checked "export" for every library, because I want to have them in my one single .jar-file included.
I wrote an Ant-target, which creates the .jar file:


<target name="jar" depends="all" description="build jar">
<manifest file="MANIFEST.MF">
  <attribute name="Main-Class" value="org.apache.mahout.fpm.pfpgrowth.FPGrowthDriver"/>
</manifest>



<jar update="false" destfile="/home/bjacobs/psd.jar" manifest="MANIFEST.MF">
  <fileset dir="${basedir}/out/production/ParallelSD/"/>
</jar>

</target>

Unfortunately when building the the project, no libraries are exported to "${basedir}/out/production/ParallelSD/", there are only the files I wrote.

How am I supposed to export the libraries and include them in my .jar-file?

Thanks a lot!

Björn

3 comments
Comment actions Permalink

Hi Björn,

So, your build procedure consists from at least two disjoint steps for now:

  1. Compile sources from IDEA;
  2. Build '*.jar' from command line;


That's rather inconvenient because you need to perform two activities in order to get target result.

I'd suggest to decide how you want to setup the buildmastering for now. There are at least two ways:

  1. IDEA-based: you can configure artifacts to produce from your project and build them via IDEA. Feel free to check Artifacts concept and configuration;
  2. Ant-based: you can setup your ant script in a way that it knows about libraries used by IDEA, performs sources compilation and final assembly;


There is a significant drawback with the second approach that ant and IDEA configurations may become inconsistent. You can use JPS tool then - it provides groovy interface for working with IDEA config files. IDEA Community Edition uses it itself, so, feel free to check it out and see in action.

Regards, Denis

0
Comment actions Permalink

Dear Denis,

I used method 1 you proposed and now it is working fine.
This simplyfies my work quite well.
Thank you and keep up the good work on IDEA!

Björn

0
Comment actions Permalink

Hi Björn,

Thanks!

0

Please sign in to leave a comment.