【发布时间】:2014-01-08 01:29:06
【问题描述】:
我正在尝试使用 maven 发布插件,但我遇到了阻止我使用它的错误。
我的文件夹结构:
+root
+parent
pom.xml
+projectA
pom.xml
+projectB
pom.xml
pom.xml
根/父/pom.xml
<project ...>
<groupId>org.acme</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>throttling</name>
<url>http://maven.apache.org</url>
...
<scm>
<connection>scm:hg:https://code.google.com/***</connection>
</scm>
<distributionManagement>
<repository>
<id>deployment</id>
...
</repository>
<snapshotRepository>
<id>deployment</id>
...
</snapshotRepository>
</distributionManagement>
</project>
root/pom.xml
<project ...>
<artifactId>throttling-modules</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>throttling</name>
<url>http://maven.apache.org</url>
<parent>
<groupId>org.acme</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath />
</parent>
<modules>
<module>projectA</module>
<module>projectB</module>
</modules>
<scm>
<connection>scm:hg:https://code.google.com/***</connection>
</scm>
<distributionManagement>
<repository>
<id>deployment</id>
...
</repository>
<snapshotRepository>
<id>deployment</id>
...
</snapshotRepository>
</distributionManagement>
</project>
root/projectA/pom.xml
<project ...>
<parent>
<groupId>org.acme</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath />
</parent>
<artifactId>thr-common</artifactId>
<version>1.0-SNAPSHOT</version>
<name>thr-common</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
...
</project>
我执行了运行良好的命令“mvn release:prepare”。
之后我执行了 'mvn release:perform' 但我收到了下一条错误消息 (mvn release:perform -Dusername=???? -Dpassword=????? -DconnectionUrl=scm:hg:https://code.google.com/???):
[INFO] Checking out the project to perform the release ...
[INFO] Removing D:\work\throttling\code_google\***\throttling\parent\target\checkout
[INFO] EXECUTING: cmd.exe /X /C "hg clone -r release_parent-1.1 https://***:***@code.google.com/*** D:\work\throttling\code_google\***\throttling\parent\target\checkout"
[INFO] EXECUTING: cmd.exe /X /C "hg locate"
[INFO] Executing goals 'deploy'...
[WARNING] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] [INFO] Scanning for projects...
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD FAILURE
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (D:\work\throttling\code_google\***\throttling\parent\target\checkout). Please verify you invoked Maven from the correct directory. -> [Help 1]
throttling\parent\target 中的文件夹结构
+throttling\parent\target
+checkout
+throttling
+parent
+projectA
+projectB
谢谢, 五、
【问题讨论】:
-
你在根文件夹中运行 mvn release:perform 对吗?
-
嗨 emelendez,我假设首先我必须将父项目发布到非快照版本,然后我可以发布其余项目。还是我弄错了?谢谢,V。
-
我需要知道哪个 pom.xml(根或父)在 xml 中有模块部分。你能确认一下吗?
-
嗨,emendelez,再次感谢!模块部分位于 root/pom.xml 中。五、
-
感谢提供信息,首先你需要删除 -SNAPSHOT 然后在根项目中运行 mvn release:perform