繁体   English   中英

将nexus生命周期配置为Maven构建的一部分

[英]Configuring nexus lifecycle as part of the maven build

我正在尝试配置Maven构建以运行关系生命周期(Sonatype clm),到目前为止,我已经将以下内容添加到我的项目pom中:

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.sonatype.clm</groupId>
                <artifactId>clm-maven-plugin</artifactId>
                <version>2.6.0-01</version>
                <configuration>
                    <serverUrl>http://localhost:8070</serverUrl>
                    <applicationId>test</applicationId>
                    <stage>develop</stage>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

然后,我将添加到$ {User.home} /。m2文件夹中的settings.xml文件:

<servers>
    <server>
         <id>nexus-site</id>
         <username>nexus_username</username>
         <password>nexus_password</password>
    </server>
</servers>

到目前为止,我遇到的问题是,当我尝试运行命令: mvn package clm:evaluate -DskipTests ,出现构建失败。 我得到的错误是:

[ERROR] Failed to execute goal com.sonatype.clm:clm-maven-plugin:2.6.0-01:evaluate (default-cli) on project backend: Could not save module scan to C:\Users\user\git\backend\target\sonatype-clm\scan.xml.gz: Unauthorized -> [Help 1]

有谁知道这可能是什么以及如何解决它? 提前致谢。

似乎是身份验证问题。 如文档所述,您需要在pom文件的配置中添加serverId标记-

clm.serverId用于身份验证,并且必须与在Maven设置中指定给CLM服务器的ID相匹配

编辑 :尝试使用下面提到的配置运行相同的命令:

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.sonatype.clm</groupId>
                <artifactId>clm-maven-plugin</artifactId>
                <version>2.6.0-01</version>
                <configuration>
                    <serverUrl>http://localhost:8070</serverUrl>
                    <stage>develop</stage>
                    <applicationId>test</applicationId>
                    <serverId>nexus-site</serverId>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>evaluate</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM