maven编译依赖快照版本有时间,导致依赖库找不到
MANIFEST.MF文件里面的信息:
Manifest-Version: 1.0
Built-By: Administrator
Build-Jdk: 1.6.0_10-rc2
Class-Path: lib/storage-1.0-20131202.054649-56.jar lib/compframe-1.0-2 0131202.072442-8.jar
实际下载到lib目录中的是storage-1.0--SNAPSHOT.jar这样。
pom文件:
...
org.apache.maven.plugins
maven-compiler-plugin
3.0
lib
UTF-8
<!-- 设置程序入口类,并设置依赖目录 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib</classpathPrefix>
<mainClass>main.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<!-- 设置依赖库到打包生成目录下的lib目录 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/lib
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
...