问题标签 [maven-deploy-plugin]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
232 浏览

maven-3 - How to stop maven-deploy-plugin:deploy-file deploying source?

I have a WAR project that also produces some extra artefacts that I want to deploy to my artifact repo. So I have configured executions under the deploy plugin to deploy each of the extra artefacts

But each execution will try and deploy the javadoc and sources for the project, even though I have tried to explicitly switch them off for the execution. NB I want javadoc and sources for the project, but I only want them deployed once (by deploy mojo).

This isn't a big deal until it comes to release time at which point my build breaks because it tries to deploy the javadoc and source for the deploy mojo as well as each of the deploy-file mojo executions to a release repo that doesn't allow redeploy of artifacts.

Is it possible to configure the maven-deploy-plugin to not deploy source & javadoc for the deploy-file mojo?

0 投票
1 回答
1073 浏览

java - Maven 部署插件

我一直在将我们的 maven 构建服务器从 Maven 2 迁移到 Maven 3。我正在设置 maven 以使用 scp 将新的 java 应用程序部署到远程服务器。但是,当我运行“mvn install”时,会收到以下消息。

这是有关我正在使用的系统的一些信息。

在 4GB 总内存的 Ubuntu 14.04 上运行。

每次运行时我都会收到相同的错误消息mvn install。在java堆空间异常之前的最后一个命令中下载的文件 Downloading: scp://mvn.FooCorp.com/var/www/maven2/com/Foo/Foo/S88-SNAPSHOT/maven-metadata.xml ......远程服务器上确实存在(我可以访问它,所以我检查了)。根据 MA​​VEN_OPTS,Maven 似乎有足够的内存。另外,我使用 top 命令观察了系统内存,它几乎没有使用超过 1.5GB 的内存。我已经看过许多其他解决方案来解决诸如此类的问题,它们都涉及给 Maven 更多内存,但我认为 2GB 应该可以满足 maven 的任何需求(我可能错了)。不确定这是否有帮助,但我能够运行“mvn install”并且它运行良好。唯一的问题是 Maven 部署命令。

wagon 插件在我的 POM.xml 中配置,如下所示

并且 maven-deploy-plugin 配置在 POM 中配置如下......

我一直很难解决这个问题,不知道还有什么可以尝试的。任何可能的解决方案或一般建议将不胜感激。

如有必要,我可以添加更多信息。

感谢您提供任何帮助。

0 投票
1 回答
11136 浏览

maven - Maven maven-deploy-plugin 总是上传两次

将组件发布到 Nexus 存储库时出现问题,Maven 将文件上传两次:

  • 第一次使用 maven-deploy-plugin groupId/artifactId/version 参数(这就是我想要的)
  • 第二次使用 pom groupId/artifactId/version 参数(这就是我不想要的)

我使用以下命令启动打包/部署(请参阅底部的 pom.xml 文件):

mvn clean package deploy:deploy-file -e -f pom.xml

这是处理部署阶段时的 maven 输出控制台片段(前 6 行是正确的,但请注意最后 2 行带有 pom groupId/artifactId/version):

这是我的 pom.xml 文件:

有什么想法可以解决吗?

谢谢你的帮助。

[编辑]

使用命令行mvn deploy:deploy-file -e -f pom.xml,它运行良好(whitout clean package),但我需要在部署之前打包......

0 投票
1 回答
4998 浏览

maven - Maven 嵌入式部署不适用于 org.apache.httpcomponents.httpclient 4.4 版

在我的应用程序中,我必须(mvn)以编程方式部署工件。我在 maven-embedder 工件和一些非常简单的代码的帮助下做到了这一点:

为了能够做到这一点,我必须在我的 pom 中添加以下依赖项:

问题是,当我将 httpclient 的版本更改为 4.4 版本(最新版本)时,尝试部署时出现以下错误:

任何人都有一个想法,为什么部署在 org.apache.httpcomponents.httpclient 的 4.3.x 版本中运行良好,而在 4.4 版本中失败?

0 投票
0 回答
1017 浏览

maven-3 - 执行发布时在最后部署

我试图弄清楚,是否可以在发布结束时部署所有工件。

我运行了以下命令(将 -D 参数传递给 Maven 中的发布插件):

输出包含部署结束的信息,但没有发生:

0 投票
0 回答
353 浏览

maven - 如何将多模块工件从存储库复制到另一个?

我试图找出将现有工件从一个存储库复制到另一个存储库的最佳方法。

可以使用 maven-deploy-plugin 手动完成,但是当我有一个多模块项目时怎么办?

手动,我会下载所有模块(fe 与 maven-dependency-plugin 及其目标复制依赖项)并使用正确的参数使用 maven-deploy-plugin 手动部署它们。

我怎样才能在 Maven 方式上做到这一点?

0 投票
1 回答
2193 浏览

maven - How to deploy additional artifacts in maven without hardcoding a repository?

In my maven pom, I have an additional jar-file that I'd like to include with my deployables. I've got the jar-file building successfully, and I figured I'd use the maven-deploy-plugin, like so (version-wise, I'm using 2.8.2 from dependencyManagement):

This works great, but there's a slight issue. If you notice, the above pom is using project.distributionManagement.repository.url for both the repositoryId and url parameters. However, this means that regardless of if I'm building a snapshot or a release version, I'm always deploying to me release-area, which is not ideal. What if I'm building a snapshot? Well, the answer seems to be to change project.distributionManagement.repository.url to project.distributionManagement.snapshotRepository.url

I don't like the idea of changing these lines manually because I like to use the maven-release-plugin to switch between snapshot and release versions. Now, I'd have to add some scripting to change these lines each time. That's possible, but not ideal.

It seems that someone asked about this exact problem before back in 2008, and there wasn't really a good answer: http://maven.40175.n5.nabble.com/problems-with-the-maven-deploy-plugin-td107307.html So, I thought I'd add it here to see what people have come up with.

I'm considering using the build-helper plugin to dynamically change this property, but that seems like a potential rabbit-hole, especially since someone tried to do something similar before (for other reasons, but the concept is similar): Check if Maven pom is SNAPSHOT

So, what's the right answer here? Should this be a feature-request? Or, is there a simple way to work around this problem that people use? I'm curious what others have done. Has anyone had any luck with the build-helper plugin?

Thank you!

0 投票
1 回答
46 浏览

maven - 在发布期间剥离 Pom?

我希望我的 pom 在一个面向公众的存储库中以帮助进行传递依赖计算,但我不希望我的源代码控制和其他详细信息包含在公共 pom 中。

有没有一种标准方法可以将 pom 剥离到它们的基本要素,或者我会使用 xslt 插件并编写一个转换来过滤我希望排除的内容?

谢谢

彼得

0 投票
2 回答
6988 浏览

maven - 如何在无需指定配置文件的情况下将多个 Maven 工件部署到多个关系存储库(包括快照存储库)?

我们有一个网关客户端项目,它是多模块 Maven 项目的一部分。gateway-client pom.xml 配置为创建两个主要工件:gateway-client.jar 和 gateway-services-client.jar 并将它们部署到两个单独的 Nexus 存储库:分别是 Releases 存储库和 3rd 方存储库。这是通过默认激活的配置文件完成的:

问题是因为这个配置文件在默认情况下是活动的,如果我们尝试运行 amvn deploy并且 GAV 坐标的版本是 -SNAPSHOT,构建仍然会无意中尝试部署到 Nexus 3rd Party 并发布 repos 并且失败,因为它当然是不接受 -SNAPSHOT 工件版本。为了解决这个问题,我专门为 -SNAPSHOT 版本设置了一个配置文件,它只会部署到快照存储库:

这样做的问题是您必须在执行 Maven 命令时指定配置文件:mvn deploy -P 'snapshot'. 我的问题是我该怎么做才能在mvn deploy不指定快照配置文件的情况下运行,并让构建自动部署到快照存储库或第 3 方并发布存储库,所有这些都基于版本中 -SNAPSHOT 的存在GAV 坐标?

0 投票
0 回答
494 浏览

maven - maven-release-plugin 部署目标不使用自定义 settings.xml 值

我想我发现 maven 目标“部署”到 maven-release-plugin 执行中有一个奇怪的问题。

当我使用“-s”或“-gs”选项构建具有自定义设置(maven settings.xml)的版本时,内部目标“部署”不使用自定义设置(似乎使用$M2_HOME/conf/settings.xml)。是错误还是我做错了什么?我努力了 :

  • mvn release:prepare release:perform -s /opt/maven-3.0.4/conf/settings.xml
  • mvn release:prepare release:perform -Darguments="-s /opt/maven-3.0.4/conf/settings.xml"
  • mvn -DmavenHome=/opt/maven-3.0.4/ release:prepare release:perform

没有任何作用...

调试: