gpt4 book ai didi

java - Maven 站点 :deploy error: "Error uploading site: Error performing commands for file transfer: Exit code: 0 - The syntax of the command is incorrect."

转载 作者:行者123 更新时间:2023-11-30 07:01:11 25 4
gpt4 key购买 nike

我正在尝试使用 Maven 的 site:deploy 功能将项目站点部署到本地网络上的服务器。服务器运行的是 Windows Server 2012。

我已经在其上成功设置了 Apache Archiva Maven 存储库,并且我能够部署我的项目并从中提取依赖项。

当我运行mvn site:deploy时,我明白了:

[INFO] --- maven-site-plugin:3.6:deploy (default-deploy) @ piserver ---
[INFO] Pushing C:\Users\Eric\Development\Projects\Java\PiServerJava\target\site
[INFO] >>> to scp://192.168.1.215/inetpub/wwwroot/software/projects/piserver/./
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.631 s
[INFO] Finished at: 2016-11-30T10:11:55-07:00
[INFO] Final Memory: 22M/219M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-
plugin:3.6:deploy (default-deploy) on project piserver: Error uploading
site: Error performing commands for file transfer: Exit code: 0 - The syntax
of the command is incorrect.

我的 POM <distributionManagement>部分如下所示:

<distributionManagement>
<site>
<id>etv-site</id>
<url>scp://192.168.1.215/inetpub/wwwroot/software/projects/piserver/</url>
</site>
</distributionManagement>

和我的settings.xml <server>部分如下所示:

<server>
<id>etv-site</id>
<username>********</username>
<password>********</password>
</server>

对于我的货车提供商,我使用

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.10</version>
</dependency>
</dependencies>
</plugin>

无论我如何尝试获取 <distributionManagement> 中的网址, 我犯了同样的错误。我试过了

  • scp://192.168.1.215/inetpub/wwwroot/software/projects/piserver/
  • scp://192.168.1.215/C:/inetpub/wwwroot/software/projects/piserver/
  • scp://192.168.1.215/software/projects/piserver/

等等。

我尝试过的其他事情:

  • 网址:scp:http://192.168.1.215/inetpub/wwwroot/software/projects/piserver/ ;错误:Cannot connect. Reason: java.net.UnknownHostException .
  • 网址:sftp://192.168.1.215/inetpub/wwwroot/software/projects/piserver/ ;错误:Error uploading site: Exit code: 0 - 'chmod' is not recognized as an internal or external command,
    [ERROR] operable program or batch file.

作为引用,我的 Archiva 存储库 URL 如下所示:

<repository>
<id>etv-internal</id>
<url>http://192.168.1.215:8080/repository/internal</url>
</repository>
<snapshotRepository>
<id>etv-snapshots</id>
<url>http://192.168.1.215:8080/repository/snapshots</url>
</snapshotRepository>
<小时/>

更新:

sftp://解决方案成功部署了我的网站,但我仍然收到 chmod 错误。不过,我仍然想使用 scp 而不是 sftp。

最佳答案

取消删除答案并保留问题中编辑内容的状态。您应该执行命令

mvn site:deploy

使用site-plugin部署包

为了将站点部署的 chmod 设置为 false,您可以使用以下配置:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<chmod>false</chmod>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.10</version>
</dependency>
</dependencies>
</plugin>

这也不需要更改插件的执行阶段。

关于java - Maven 站点 :deploy error: "Error uploading site: Error performing commands for file transfer: Exit code: 0 - The syntax of the command is incorrect.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40894795/

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