使用以下命令行:
mvn 版本:解锁快照依赖项:复制依赖项
我在依赖文件夹中获得了所有具有 SNAPSHOT.jar 名称的快照 jar。
为什么将我的项目打包成战争时没有得到相同的行为?我没有得到 mylibs-modules-1.0-SNAPSHOT.jar,而是得到了那些递增的数字。
已编辑
<project>
<modelVersion>4.0.0</modelVersion>
<artifactId>mylibs</artifactId>
<packaging>war</packaging>
<version>3.4</version>
<parent>
<groupId>parent</groupId>
<artifactId>mylibs-parent</artifactId>
<version>3.4</version>
</parent>
<build>
<finalName>mylibs-war</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
</plugins>
</build>
父 POM 文件
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>parent</groupId>
<artifactId>mylibs</artifactId>
<packaging>pom</packaging>
<version>3.4</version>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>mylibs</groupId>
<artifactId>mylibs-tests</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mylibs</groupId>
<artifactId>mylibs-processor</artifactId>
<version>1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mylibs</groupId>
<artifactId>mylibs-persistence</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mylibs</groupId>
<artifactId>mylibs-databean</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mylibs</groupId>
<artifactId>mylibs-localization</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mylibs</groupId>
<artifactId>mylibs-net</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mylibs</groupId>
<artifactId>mylibs-lang</artifactId>
<version>1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mylibs</groupId>
<artifactId>mylibs-metadata</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mylibs</groupId>
<artifactId>mylibs-events</artifactId>
<version>1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mylibs</groupId>
<artifactId>mylibs-logging</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>