【问题标题】:Deploying a maven site to Nexus-3 via https通过 https 将 maven 站点部署到 Nexus-3
【发布时间】:2018-02-22 14:19:17
【问题描述】:

好的,情况如下:

我有一个多模块 Maven 项目(目前使用 v3.5.2),它有一个大型站点部署,不久前我使用简单的 http 将 Maven 站点 (mvn clean site site:deploy) 部署到 Nexus-2.x 站点存储库.

迁移到 Nexus-3.8.0 后,我考虑将整个服务器放在一个反向代理后面,只允许 https,到目前为止运行良好。不幸的是,我无法将站点部署到新的原始存储库,该存储库应该包含我的 maven 项目中的站点。

目前的配置是这样的

                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.0.0</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.wagon</groupId>
                        <artifactId>wagon-webdav-jackrabbit</artifactId>
                        <version>3.0.0</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <locales>en_US</locales>
                </configuration>
            </plugin>

运行上面的命令给了我

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.7:deploy (default-cli) on project server-policies: Wagon protocol 'https' doesn't support directory copying -> [Help 1]

我的站点配置如下所示:

<distributionManagement>
    <site>
        <id>sites-repository</id>
        <url>dav:https://nx3.mydomain/repository/prd-${project.artifactId}</url>
    </site>
    ...
</distributionManagement>

有没有办法使用 https 将网站上传到 Nexus-3.x 存储库?

【问题讨论】:

  • 您能展示一下您的&lt;site&gt; 配置吗?

标签: maven-3 maven-site-plugin nexus3


【解决方案1】:

不,这是不可能的。您必须使用 http 作为站点存储库。

【讨论】:

    【解决方案2】:

    您遇到的问题是distributionManagement.site.url/ 结尾的结果

    假设您在设置文件中正确设置了&lt;servers&gt;&lt;server&gt;&lt;id&gt;sites-repository....,这将正常工作。

    执行mvn help:effective-pom 并查看您的&lt;distributionManagement&gt; 部分。

    【讨论】:

    • 请注意,dav:https://nx3.mydomain/repository 必须(以某种方式)指向托管的原始存储库。我们的看起来更像dav:https://nx3.domain/repository/sites,其中sitesraw 类型的托管存储库。
    • 我们的 repo 被代理在 AWS 上的 LB 后面,所以 YMMV 使用这个。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-27
    • 2013-03-06
    • 1970-01-01
    • 1970-01-01
    • 2023-03-14
    • 2015-10-31
    相关资源
    最近更新 更多