简体   繁体   中英

Maven extract jar, compile new with dependencies

I have a 3rd party jar with source files that I've added to my local repo. Now I want to extract it, compile it with it's dependencies, and finally package it into a new single jar.

I've completed the first step, by using the maven-dependency-plugin . It extracts the jar from the repo into target/sources .

How do I set the compiler phase to include that directory during compilation? I would expect it to generate errors at first, since it has other dependencies not in the pom.xml yet.

I've come across the assembly-plugin but I'm not sure if that would replace compiler-plugin?

Q: Why not get the compiled version (the jar, containing the compiled Java code ( *.class files)) of the 3rd party library.

Q: Is the 3rd party, source code available from svn / git / etc?

Q: Does the source jar or the svn / git scm, contain a Maven pom.xml file, or Ant build.xml , or Gradle build.gradle ? Then use that to compile the code.

About the Maven Plug-ins

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM