我正在尝试将项目从Maven 2迁移到Maven 3。
所以我用Maven 2来部署项目。现在,我开始使用Maven3。Install
命令正常。但是在尝试部署项目时出现一些错误:
[ERROR] Failed to execute goal on project IManager: Could not
resolve dependencies for project com.company:IManager:ejb:2.4.0-SNAPSHOT:
Could not find artifact com.company:AManager:jar:clover:0.32-20180823.111757-2
in projects.PRKEY.snapshot (https://subversion.company.com/maven/repository/PRKEY/snapshot)
-> [Help 1]
在使用Maven 3进行构建时,我使用此命令。
clean install deploy -Dmaven.metadata.legacy=true -fae -Dsurefire.useFile=false
com.atlassian.maven.plugins:maven-clover2-plugin:2.6.3:aggregate
com.atlassian.maven.plugins:maven-clover2-plugin:2.6.3:clover
我尝试添加-U
。那无济于事。
我在 target 文件夹中有 AManager-clover.jar :target/clover/AManager-clover.jar
我使用Nexus和Bamboo。
在本地存储库中,我看到以下文件:
AManager-0.32-20180823.111757-2-clover.jar.lastUpdated
AManager-0.32-20180823.111757-2.pom
AManager-0.32-20180823.111757-2.pom.lastUpdated
AManager-0.32-20180823.111757-2.pom.sha1
AManager-0.32-SNAPSHOT-client.jar
AManager-0.32-SNAPSHOT-clover.jar
AManager-0.32-SNAPSHOT.jar
AManager-0.32-SNAPSHOT.jar.sha1
AManager-0.32-SNAPSHOT.pom
AManager-0.32-SNAPSHOT.pom.sha1
AManager-0.32-SNAPSHOT-sources.jar
maven-metadata-apt.snapshots.m1.xml
maven-metadata-apt.snapshots.xml
maven-metadata-local.xml
maven-metadata-projects.pr.snapshot.xml
maven-metadata-projects.pr.snapshot.xml.sha1
_maven.repositories
resolver-status.properties
IManager和AManager是一个项目的不同模块,该项目以前是由Maven 2构建的,但是我需要使用Maven 3进行构建。
在https://subversion.company.com/maven/repository/PRKEY/snapshot中,我看不到三叶草文件,只有以下jar(+ md5,sha1文件等):
AManager-0.32-20180823.111757-2.jar
AManager-0.32-SNAPSHOT.jar
IManager和AManager具有相同的父层次结构。这是在父级中配置的三叶草设置:
<pluginmanagement>
<plugins>
<plugin>
<groupid>com.atlassian.maven.plugins</groupid>
<artifactid>maven-clover2-plugin</artifactid>
<version>2.6.3</version>
<configuration>
<jdk>${jdk.version}</jdk>
<flushinterval>100</flushinterval>
<flushpolicy>threaded</flushpolicy>
<targetpercentage>0%</targetpercentage>
<licenselocation>${clover2.licenseLocation}</licenselocation>
<generatexml>true</generatexml>
<contextfilters>try,static</contextfilters>
<generatehistorical>true</generatehistorical>
<includes>
<include>**/*.java</include>
</includes>
<historydir>${user.home}/clover-history/${project.artifactId}</historydir>
</configuration>
<dependencies>
<dependency>
<groupid>org.codehaus.plexus</groupid>
<artifactid>plexus-resources</artifactid>
<version>1.0-alpha-7</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginmanagement>
<plugins>
<plugin>
<artifactid>maven-clover2-plugin</artifactid>
<groupid>com.atlassian.maven.plugins</groupid>
<configuration>
<licenselocation>${clover2.licenseLocation}
</licenselocation>
</configuration>
<executions>
<execution>
<id>analyse-code</id>
<phase>verify</phase>
<goals>
<goal>instrument</goal>
<goal>clover</goal>
<goal>save-history</goal>
</goals>
</execution>
<execution>
<id>quality-checks</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
<execution>
<id>data-aggregation</id>
<phase>pre-site</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
Maven在输出中说AManager模块已成功部署。
实际上,我不理解它应该如何工作:
如果对这些问题有帮助,我将不胜感激。