Friday, 15 August 2014

eclipse - Why does my jar file contains nothing but the META-INF directory, when I deploy my artifact to Nexus by Maven? -



eclipse - Why does my jar file contains nothing but the META-INF directory, when I deploy my artifact to Nexus by Maven? -

when deploy project nexus, have managed deploy jar file, file contains nil "meta-inf" folder (which contains pom.xml).

where class files , other resources? there configuration tag in pom.xml specifies files packed artifact? (by way, work parent pom.)

(i haven never tried deploy artifacts nexus before, first attempt.)

the code under test/java folder.

if want bundle classes jar need have them in src/main/java. area src/test/ not packaged jar file

if having jar file contains things src/test/ in rare cases usefull have go different way following:

class="lang-xml prettyprint-override"><project> ... <build> <plugins> ... <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-jar-plugin</artifactid> <version>2.4</version> <executions> <execution> <goals> <goal>test-jar</goal> </goals> </execution> </executions> </plugin> ... </plugins> </build> ... </project>

but have aware using such dependency must done this:

class="lang-xml prettyprint-override"><project> ... <dependencies> <dependency> <groupid>groupid</groupid> <artifactid>artifactid</artifactid> <type>test-jar</type> <version>version</version> <scope>test</scope> </dependency> </dependencies> ... </project>

here of import utilize 'test-jar'. src/test/ area used unit tests don't need packaged jar file.

eclipse maven jar nexus

No comments:

Post a Comment