私はMavenを初めて使用し、プロジェクトを戦争として、そしてjarとして展開しようとしています。プロジェクトを分割して同じことをしたいのですが、大きすぎて単純な時間で実行できません。
mavenが追加のjarファイルをデプロイしているのを見つけました。これは、いくつかのプラグインを追加することを提案しました。
インストールプラグインはうまく機能します
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<packaging>jar</packaging>
<artifactId>${project.artifactId}</artifactId>
<groupId>${project.groupId}</groupId>
<version>SNAPSHOT</version>
<file>
${project.build.directory}/${project.artifactId}-SNAPSHOT.jar
</file>
</configuration>
</execution>
</executions>
</plugin>
出力は次のとおりです。
[INFO] [install:install-file {execution: default}]
[INFO] Installing C:\Server\example\code\server\my-project\target\my-project-SNAPSHOT.jar to C:\Users\Kyle\.m2\repository\com\example\main-project\my-project\SNAPSHOT\my-project-SNAPSHOT.jar
問題はmaven-deploy-pluginにあります。私が強制的に使用しているSNAPSHOTバージョンを無視しているようです。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<executions>
<execution>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<packaging>jar</packaging>
<generatePom>true</generatePom>
<url>${project.distributionManagement.snapshotRepository.url}</url>
<artifactId>${project.artifactId}</artifactId>
<groupId>${project.groupId}</groupId>
<version>SNAPSHOT</version>
<!--${project.version}!="SNAPSHOT" for some reason-->
<file>${project.build.directory}/${project.artifactId}-SNAPSHOT.jar</file>
</configuration>
</execution>
</executions>
</plugin>
他のバージョン番号(YYYYMMDD.HHmmSS-#)を使用しているようです
[INFO] [deploy:deploy-file {execution: default}]
[INFO] Retrieving previous build number from remote-repository
Uploading: http://build.example.biz:8081/artifactory/libs-snapshots-local/com/example/main-project/my-project/SNAPSHOT/my-project-20120625.161551-2.jar
42993K uploaded (my-project-20120625.161551-2.jar)
私は何が間違っているのですか?