gpt4 book ai didi

使用 ftp 上传 : I want to upload just the war file but is uploading more files 的 maven 部署

转载 作者:行者123 更新时间:2023-12-01 09:09:03 25 4
gpt4 key购买 nike

我完全按照此处指定的说明进行操作:

http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ftp.html

(唯一的区别是我使用的是 2.4 版的 wagon-ftp)。

然后执行

mvn deploy

我只想上传一个 war 文件,但它会上传几个其他文件,扩展名为 pom、md5、sha1,并将它们埋在我的一个源目录下。

我一直在尝试寻找适当的配置来修改此行为,但没有成功。

最佳答案

使用 Ant,它是 FTP task为了上传生成的 war 文件。

antrun plugin你可以像这样执行你的 ant 脚本:

 <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<configuration>
<target>
<property name="file_name" value="${project.build.finalName}.war" />
<ant antfile="${basedir}/build.xml">
<target name="war upload" />
</ant>
</target>
</configuration>
</plugin>

使用 property 来定义一些属性,例如文件名/ant 脚本的路径。所有 Maven 的属性也可以在 ant 脚本中访问。

关于使用 ftp 上传 : I want to upload just the war file but is uploading more files 的 maven 部署,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15884708/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com