• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Maven - Extract a jar from a zip file, and then use it for compile/build.

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings,

I have the following scenario :

1) A .rar file that contains jar files, and some of these jars i need to build my project with. The rar file is setup in the remote repository.
2) As a part of the Maven build, I need to extract the .rar file, place the contained jars at some location, and then use these jars to compile the project. There are other <dependencies> mentioned in the pom, and these jars should also be used with them while compiling.
3) I used the maven-dependency-plugin to extract the jars from the .rar, to the project build directory, but cannot get Maven to pick them up as dependencies while compiling (even system scope fails).

Please suggest on how to do extract from the rar, take the jars and use them to build, all in the same maven build.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try the addjars plugin: http://code.google.com/p/addjars-maven-plugin/

Personally, I would extract the JARs from the RAR and load them into the remote repository and then reference them as dependencies. If the problem with that is that you are getting an update RAR almost daily from another team, then you can either tell them to also include the JARs in the repository when they do their build (its easy to do using the build-helper:attach-artifact goal - http://mojo.codehaus.org/build-helper-maven-plugin/attach-artifact-mojo.html), or you can create a separate POM that does the JAR extract just like you are doing now and then load the JARs into the repository. Heck, you could even do that in the same POM as for your build, placing the JARs in the local repository and using them from there. That would even work within a Hudson build slave.
reply
    Bookmark Topic Watch Topic
  • New Topic