Java: Maven and Library compiling -
i'm trying compile project has got maven dependencies , normal dependencies (the ones add .jar buildpath/lib). however, can choose 1 ;( either, compile maven, or compile artifacts, , won't make project work.
i use
<build> <plugins> <plugin> <artifactid>maven-assembly-plugin</artifactid> <configuration> <archive> <manifest> <mainclass>me.expdev.testproject.main</mainclass> </manifest> </archive> <descriptorrefs> <descriptorref>jar-with-dependencies</descriptorref> </descriptorrefs> </configuration> </plugin> </plugins> </build>
and
mvn clean compile assembly:single
to compile. have 5 jars (which not available maven) need included in packaging jar output! works fine when run main in ide.
i use intellij community edition.
you can package 3rd party jars maven artifacts.
mvn install:install-file -dfile=<path-to-file> -dgroupid=<group-id> \ -dartifactid=<artifact-id> -dversion=<version> -dpackaging=jar
the <group-id>
, <artifact-id>
, <version>
fields fill, choose values seem appropriate you. artifact available maven these values. see other maven artifacts in project examples. group id, choose prefix make clear it's not publicly published jar, avoid confusion. example custom.
, in custom.some.package
, it's you.
for more details, see: guide installing 3rd party jars
also keep in mind other developers want use project have same, , manually install jars in local maven repositories. option run own maven repository. see article: http://stuartsierra.com/2009/09/08/run-your-own-maven-repository .
Comments
Post a Comment