利用maven插件打jar包时自定义Class-path到META-INF

<build>
  <plugins>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <version>2.3</version>
    <configuration>
     <archive>
      <manifest>

       <mainClass>
        scallop.sca.sample.rmi.Server
       </mainClass>
       <addClasspath>true</addClasspath>
       <classpathPrefix>http://10.11.85.17:8081/nexus/content/groups/public/</classpathPrefix>
       <classpathLayoutType>repository</classpathLayoutType>
       <!--classpathMavenRepositoryLayout>true</classpathMavenRepositoryLayout-->
      </manifest>
     </archive>
    </configuration>
   </plugin>
  </plugins>
 </build>

注意:这个必须是2.3版本,2.4版本用注释的内容

http://maven.apache.org/shared/maven-archiver/examples/classpath.html

你可能感兴趣的:(maven,jar)