独立父 pom 部署问题
standalone parent pom deployment issue
我有一个简单的父 pom,用于公司名称的集中定义和与工件存储库的连接
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.company</groupId>
<artifactId>pom-company</artifactId>
<version>1.3-SNAPSHOT</version>
<packaging>pom</packaging>
<organization>
<name>My company name</name>
</organization>
<scm>
<connection>scm:git:http://gitlab/projects/pom-company.git</connection>
<developerConnection>scm:git:git@gitlab/projects/pom-company.git</developerConnection>
<url>http://gitlab/projects/pom-company</url>
<tag>HEAD</tag>
</scm>
<distributionManagement>
<repository>
<id>archiva.internal</id>
<name>Internal Release Repository</name>
<url>http://archiva/repository/internal</url>
</repository>
</distributionManagement>
</project>
它还包含一个经过验证的有效 <scm>
连接。现在我 release:prepare
&& release:perform
但是工件(在本例中为 1.3 版)不会按预期由 maven 部署到工件存储库。令人惊讶的是,Snapshot 版本已部署。我的 settings.xml
中的相应配置文件仅指示启用发布版本的上传,而不是快照。到目前为止,此配置适用于所有其他项目。
另一个奇怪的事实是 pom.xml 在该过程之后仍然处于已更改但未签入 git 的状态。唯一标记为更改的是 pom.xml
:
中的这个
<version>1.4-SNAPSHOT</version>
不知道是什么原因,希望高人指点。
更新
- 我已经将上面
pom.xml
中的项目版本从1.4-SNAPSHOT修改为1.3-SNAPSHOT
- 附加信息:该项目只包含
pom.xml
- 我用的maven版本是3.3.1
这是评论中要求的 release:prepare
的输出:
------------------------------------------------------------------------
Building pom-company 1.3-SNAPSHOT
------------------------------------------------------------------------
--- maven-release-plugin:2.3.2:prepare (default-cli) @ pom-company ---
Verifying that there are no local modifications...
ignoring changes on: **/pom.xml.backup, **/release.properties, **/pom.xml.branch, **/pom.xml.next, **/pom.xml.releaseBackup, **/pom.xml.tag
Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company && git status
Working directory: /home/thomas/workspace/maven/pom-company
Checking dependencies and plugins for snapshots ...
What is the release version for "pom-company"? (de.company:pom-company) 1.3: :
What is SCM release tag or label for "pom-company"? (de.company:pom-company) pom-company-1.3: :
What is the new development version for "pom-company"? (de.company:pom-company) 1.4-SNAPSHOT: :
Transforming 'pom-company'...
Not generating release POMs
Executing goals 'clean verify'...
Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building pom-company 1.3
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ pom-company ---
[INFO] Deleting /home/thomas/workspace/maven/pom-company/target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.276 s
[INFO] Finished at: 2015-05-21T07:56:41+02:00
[INFO] Final Memory: 6M/239M
[INFO] ------------------------------------------------------------------------
Checking in modified POMs...
Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company && git add -- pom.xml
Working directory: /home/thomas/workspace/maven/pom-company
Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company && git status
Working directory: /home/thomas/workspace/maven/pom-company
Tagging release with the label pom-company-1.3...
Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company && git tag -F /tmp/maven-scm-215434904.commit pom-company-1.3
Working directory: /home/thomas/workspace/maven/pom-company
Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company && git push git@gitlab:projects/pom-company.git pom-company-1.3
Working directory: /home/thomas/workspace/maven/pom-company
Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company && git ls-files
Working directory: /home/thomas/workspace/maven/pom-company
Transforming 'pom-company'...
Not removing release POMs
Checking in modified POMs...
Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company && git add -- pom.xml
Working directory: /home/thomas/workspace/maven/pom-company
Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company && git status
Working directory: /home/thomas/workspace/maven/pom-company
Release preparation complete.
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 43.212 s
Finished at: 2015-05-21T07:56:48+02:00
Final Memory: 11M/239M
------------------------------------------------------------------------
和release:perform
的输出:
------------------------------------------------------------------------
Building pom-company 1.4-SNAPSHOT
------------------------------------------------------------------------
--- maven-release-plugin:2.3.2:perform (default-cli) @ pom-company ---
Checking out the project to perform the release ...
Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company/target && git clone --branch pom-company-1.3 git@gitlab:projects/pom-company.git /home/thomas/workspace/maven/pom-company/target/checkout
Working directory: /home/thomas/workspace/maven/pom-company/target
Executing: /bin/sh -c cd /tmp && git ls-remote git@gitlab:projects/pom-company.git
Working directory: /tmp
Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company/target/checkout && git fetch git@gitlab:projects/pom-company.git
Working directory: /home/thomas/workspace/maven/pom-company/target/checkout
Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company/target/checkout && git checkout pom-company-1.3
Working directory: /home/thomas/workspace/maven/pom-company/target/checkout
Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company/target/checkout && git ls-files
Working directory: /home/thomas/workspace/maven/pom-company/target/checkout
Invoking perform goals in directory /home/thomas/workspace/maven/pom-company/target/checkout
Executing goals 'deploy'...
Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for de.lotto.nds:pom-company:pom:1.3-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing.
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing.
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing.
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building pom-company 1.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://archiva/repository/internal/org/apache/maven/plugins/maven-source-plugin/maven-metadata.xml
Downloaded: http://archiva/repository/internal/org/apache/maven/plugins/maven-source-plugin/maven-metadata.xml (747 B at 0.6 KB/sec)
Downloading: http://archiva/repository/internal/org/apache/maven/plugins/maven-javadoc-plugin/maven-metadata.xml
Downloaded: http://archiva/repository/internal/org/apache/maven/plugins/maven-javadoc-plugin/maven-metadata.xml (911 B at 32.9 KB/sec)
[INFO]
[INFO] >>> maven-source-plugin:2.4:jar (attach-sources) > generate-sources @ pom-company >>>
[INFO]
[INFO] <<< maven-source-plugin:2.4:jar (attach-sources) < generate-sources @ pom-company <<<
[INFO]
[INFO] --- maven-source-plugin:2.4:jar (attach-sources) @ pom-company ---
[INFO]
[INFO] --- maven-javadoc-plugin:2.10.3:jar (attach-javadocs) @ pom-company ---
[INFO] Not executing Javadoc as the project is not a Java classpath-capable package
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ pom-company ---
[INFO] Installing /home/thomas/workspace/maven/pom-company/target/checkout/pom.xml to /home/thomas/.m2/repository/de/company/pom-company/1.3-SNAPSHOT/pom-company-1.3-SNAPSHOT.pom
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ pom-company ---
Downloading: http://archiva/repository/internal/de/company/pom-company/1.3-SNAPSHOT/maven-metadata.xml
Downloaded: http://archiva/repository/internal/de/company/pom-company/1.3-SNAPSHOT/maven-metadata.xml (354 B at 0.1 KB/sec)
Uploading: http://archiva/repository/internal/de/company/pom-company/1.3-SNAPSHOT/pom-company-1.3-20150521.060109-2.pom
Uploaded: http://archiva/repository/internal/de/company/pom-company/1.3-SNAPSHOT/pom-company-1.3-20150521.060109-2.pom (2 KB at 26.3 KB/sec)
Downloading: http://archiva/repository/internal/de/company/pom-company/maven-metadata.xml
Downloaded: http://archiva/repository/internal/de/company/pom-company/maven-metadata.xml (426 B at 34.7 KB/sec)
Uploading: http://archiva/repository/internal/de/company/pom-company/1.3-SNAPSHOT/maven-metadata.xml
Uploaded: http://archiva/repository/internal/de/company/pom-company/1.3-SNAPSHOT/maven-metadata.xml (592 B at 36.1 KB/sec)
Uploading: http://archiva/repository/internal/de/company/pom-company/maven-metadata.xml
Uploaded: http://archiva/repository/internal/de/company/pom-company/maven-metadata.xml (425 B at 27.7 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.222 s
[INFO] Finished at: 2015-05-21T08:01:09+02:00
[INFO] Final Memory: 16M/239M
[INFO] ------------------------------------------------------------------------
Cleaning up after release...
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 10.550 s
Finished at: 2015-05-21T08:01:10+02:00
Final Memory: 11M/239M
------------------------------------------------------------------------
您是否尝试过使用其他版本发布插件?最新的是2.5.2。您可以将其添加到 pom.xml 中,看看会发生什么
<build>
[...]
<plugins>
[...]
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.2</version>
</plugin>
[...]
</plugins>
[...]
</build>
我有一个简单的父 pom,用于公司名称的集中定义和与工件存储库的连接
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.company</groupId>
<artifactId>pom-company</artifactId>
<version>1.3-SNAPSHOT</version>
<packaging>pom</packaging>
<organization>
<name>My company name</name>
</organization>
<scm>
<connection>scm:git:http://gitlab/projects/pom-company.git</connection>
<developerConnection>scm:git:git@gitlab/projects/pom-company.git</developerConnection>
<url>http://gitlab/projects/pom-company</url>
<tag>HEAD</tag>
</scm>
<distributionManagement>
<repository>
<id>archiva.internal</id>
<name>Internal Release Repository</name>
<url>http://archiva/repository/internal</url>
</repository>
</distributionManagement>
</project>
它还包含一个经过验证的有效 <scm>
连接。现在我 release:prepare
&& release:perform
但是工件(在本例中为 1.3 版)不会按预期由 maven 部署到工件存储库。令人惊讶的是,Snapshot 版本已部署。我的 settings.xml
中的相应配置文件仅指示启用发布版本的上传,而不是快照。到目前为止,此配置适用于所有其他项目。
另一个奇怪的事实是 pom.xml 在该过程之后仍然处于已更改但未签入 git 的状态。唯一标记为更改的是 pom.xml
:
<version>1.4-SNAPSHOT</version>
不知道是什么原因,希望高人指点。
更新
- 我已经将上面
pom.xml
中的项目版本从1.4-SNAPSHOT修改为1.3-SNAPSHOT - 附加信息:该项目只包含
pom.xml
- 我用的maven版本是3.3.1
这是评论中要求的
release:prepare
的输出:------------------------------------------------------------------------ Building pom-company 1.3-SNAPSHOT ------------------------------------------------------------------------ --- maven-release-plugin:2.3.2:prepare (default-cli) @ pom-company --- Verifying that there are no local modifications... ignoring changes on: **/pom.xml.backup, **/release.properties, **/pom.xml.branch, **/pom.xml.next, **/pom.xml.releaseBackup, **/pom.xml.tag Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company && git status Working directory: /home/thomas/workspace/maven/pom-company Checking dependencies and plugins for snapshots ... What is the release version for "pom-company"? (de.company:pom-company) 1.3: : What is SCM release tag or label for "pom-company"? (de.company:pom-company) pom-company-1.3: : What is the new development version for "pom-company"? (de.company:pom-company) 1.4-SNAPSHOT: : Transforming 'pom-company'... Not generating release POMs Executing goals 'clean verify'... Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance. [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building pom-company 1.3 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ pom-company --- [INFO] Deleting /home/thomas/workspace/maven/pom-company/target [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.276 s [INFO] Finished at: 2015-05-21T07:56:41+02:00 [INFO] Final Memory: 6M/239M [INFO] ------------------------------------------------------------------------ Checking in modified POMs... Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company && git add -- pom.xml Working directory: /home/thomas/workspace/maven/pom-company Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company && git status Working directory: /home/thomas/workspace/maven/pom-company Tagging release with the label pom-company-1.3... Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company && git tag -F /tmp/maven-scm-215434904.commit pom-company-1.3 Working directory: /home/thomas/workspace/maven/pom-company Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company && git push git@gitlab:projects/pom-company.git pom-company-1.3 Working directory: /home/thomas/workspace/maven/pom-company Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company && git ls-files Working directory: /home/thomas/workspace/maven/pom-company Transforming 'pom-company'... Not removing release POMs Checking in modified POMs... Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company && git add -- pom.xml Working directory: /home/thomas/workspace/maven/pom-company Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company && git status Working directory: /home/thomas/workspace/maven/pom-company Release preparation complete. ------------------------------------------------------------------------ BUILD SUCCESS ------------------------------------------------------------------------ Total time: 43.212 s Finished at: 2015-05-21T07:56:48+02:00 Final Memory: 11M/239M ------------------------------------------------------------------------
和
release:perform
的输出:------------------------------------------------------------------------ Building pom-company 1.4-SNAPSHOT ------------------------------------------------------------------------ --- maven-release-plugin:2.3.2:perform (default-cli) @ pom-company --- Checking out the project to perform the release ... Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company/target && git clone --branch pom-company-1.3 git@gitlab:projects/pom-company.git /home/thomas/workspace/maven/pom-company/target/checkout Working directory: /home/thomas/workspace/maven/pom-company/target Executing: /bin/sh -c cd /tmp && git ls-remote git@gitlab:projects/pom-company.git Working directory: /tmp Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company/target/checkout && git fetch git@gitlab:projects/pom-company.git Working directory: /home/thomas/workspace/maven/pom-company/target/checkout Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company/target/checkout && git checkout pom-company-1.3 Working directory: /home/thomas/workspace/maven/pom-company/target/checkout Executing: /bin/sh -c cd /home/thomas/workspace/maven/pom-company/target/checkout && git ls-files Working directory: /home/thomas/workspace/maven/pom-company/target/checkout Invoking perform goals in directory /home/thomas/workspace/maven/pom-company/target/checkout Executing goals 'deploy'... Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance. [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for de.lotto.nds:pom-company:pom:1.3-SNAPSHOT [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing. [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building pom-company 1.3-SNAPSHOT [INFO] ------------------------------------------------------------------------ Downloading: http://archiva/repository/internal/org/apache/maven/plugins/maven-source-plugin/maven-metadata.xml Downloaded: http://archiva/repository/internal/org/apache/maven/plugins/maven-source-plugin/maven-metadata.xml (747 B at 0.6 KB/sec) Downloading: http://archiva/repository/internal/org/apache/maven/plugins/maven-javadoc-plugin/maven-metadata.xml Downloaded: http://archiva/repository/internal/org/apache/maven/plugins/maven-javadoc-plugin/maven-metadata.xml (911 B at 32.9 KB/sec) [INFO] [INFO] >>> maven-source-plugin:2.4:jar (attach-sources) > generate-sources @ pom-company >>> [INFO] [INFO] <<< maven-source-plugin:2.4:jar (attach-sources) < generate-sources @ pom-company <<< [INFO] [INFO] --- maven-source-plugin:2.4:jar (attach-sources) @ pom-company --- [INFO] [INFO] --- maven-javadoc-plugin:2.10.3:jar (attach-javadocs) @ pom-company --- [INFO] Not executing Javadoc as the project is not a Java classpath-capable package [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ pom-company --- [INFO] Installing /home/thomas/workspace/maven/pom-company/target/checkout/pom.xml to /home/thomas/.m2/repository/de/company/pom-company/1.3-SNAPSHOT/pom-company-1.3-SNAPSHOT.pom [INFO] [INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ pom-company --- Downloading: http://archiva/repository/internal/de/company/pom-company/1.3-SNAPSHOT/maven-metadata.xml Downloaded: http://archiva/repository/internal/de/company/pom-company/1.3-SNAPSHOT/maven-metadata.xml (354 B at 0.1 KB/sec) Uploading: http://archiva/repository/internal/de/company/pom-company/1.3-SNAPSHOT/pom-company-1.3-20150521.060109-2.pom Uploaded: http://archiva/repository/internal/de/company/pom-company/1.3-SNAPSHOT/pom-company-1.3-20150521.060109-2.pom (2 KB at 26.3 KB/sec) Downloading: http://archiva/repository/internal/de/company/pom-company/maven-metadata.xml Downloaded: http://archiva/repository/internal/de/company/pom-company/maven-metadata.xml (426 B at 34.7 KB/sec) Uploading: http://archiva/repository/internal/de/company/pom-company/1.3-SNAPSHOT/maven-metadata.xml Uploaded: http://archiva/repository/internal/de/company/pom-company/1.3-SNAPSHOT/maven-metadata.xml (592 B at 36.1 KB/sec) Uploading: http://archiva/repository/internal/de/company/pom-company/maven-metadata.xml Uploaded: http://archiva/repository/internal/de/company/pom-company/maven-metadata.xml (425 B at 27.7 KB/sec) [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 6.222 s [INFO] Finished at: 2015-05-21T08:01:09+02:00 [INFO] Final Memory: 16M/239M [INFO] ------------------------------------------------------------------------ Cleaning up after release... ------------------------------------------------------------------------ BUILD SUCCESS ------------------------------------------------------------------------ Total time: 10.550 s Finished at: 2015-05-21T08:01:10+02:00 Final Memory: 11M/239M ------------------------------------------------------------------------
您是否尝试过使用其他版本发布插件?最新的是2.5.2。您可以将其添加到 pom.xml 中,看看会发生什么
<build>
[...]
<plugins>
[...]
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.2</version>
</plugin>
[...]
</plugins>
[...]
</build>