gpt4 book ai didi

maven - Grails Release 莫名其妙地无法发布到 Nexus

转载 作者:行者123 更新时间:2023-12-02 14:48:23 24 4
gpt4 key购买 nike

背景:我正在尝试迁移项目以使用我们新的、升级的 nexus 实例而不是旧的。 Gradle 项目和 Maven 项目进展顺利,但 Grails 项目则不然。

问题:发布,并且单独发布无法发布到新的关系。快照发布工作得很好。快照和发布发布在旧的关系中运行良好,而我迁移过来的使用相同用户凭据的 Maven 和 Gradle 项目也运行良好。

错误如下

POM generated: /var/atlassian/application-data/bamboo/xml-data/build-dir/CS-AREL-JOB1/target/pom.xml.

[deploy] Deploying to https://nexus.mydomain.com/repository/maven-releases/

[deploy] Uploading: com/mydomain/myproject-admin/1.11.9/myproject-admin-1.11.9.war to repository atlassian_nexus_releases at https://nexus.mydomain.com/repository/maven-releases/

[deploy] Transferring 44484K from atlassian_nexus_releases

[deploy] Error writing to server

[deploy] An error has occurred while processing the Maven artifact tasks.

[deploy] Diagnosis:

[deploy]

[deploy] Error deploying artifact 'com.mydomain:myproject-admin:war': Error deploying artifact: Error transferring file

[deploy] Error writing to server



我需要的是一些关于在哪里看的想法,因为所有常见的检查似乎都不是问题。 用户凭据是正确的,适用于 gradle 和 maven 项目。 URL 是正确的,适用于 gradle 和 maven 项目。旧关系和新关系使用之间的构建没有改变,所以我假设构建仍然正确地产生发布 Artifact 而不是快照 Artifact 。还有什么问题?

配置:

grails.settings.groovy
grails.project.dependency.authentication = {
repositories {
mavenRepo "https://nexus.mydomain.com/repository/maven-public/"
}
credentials {
id = "atlassian_nexus"
username = "dev_read_user"
password = "****"
}
}
grails.project.ivy.authentication = {
repositories {
mavenRepo "https://nexus.mydomain.com/repository/maven-public/"
}
credentials {
realm = "Sonatype Nexus Repository Manager"
host = "atlassian.mydomain.com"
username = "dev_read_user"
password = "****"
}
}
grails.project.dependency.distribution = {
localRepository = "~/.m2/"
remoteRepository(id: "atlassian_nexus_snapshots", url: 'https://nexus.mydomain.com/repository/maven-snapshots/'){
authentication(username: 'nexus_user', password: '****')
}
remoteRepository(id: "atlassian_nexus_releases", url: 'https://nexus.mydomain.com/repository/maven-releases/'){
authentication(username: 'nexus_user', password: '****')
}
}

上面的文件在迁移过程中发生了最大的变化,所以我认为它是最有可能的罪魁祸首,尽管也有可能是 nexus 本身的某些配置可能是一个问题?

竹-build-release.sh
echo 'Making and commiting release version...';
JAVA_HOME=$bamboo_jdk_1_8 \
./grailsw version-update x.x.x --non-interactive;
git commit -m 'Increment version to release' -- application.properties;

echo 'Creating and pushing tag...';
grep app.version application.properties | cut -d"=" -f2 | xargs -I
version git tag -a version -m "Tag Release";
git push $GIT_URL --tags;

echo 'Building RELEASE war and publishing to Nexus...';
JAVA_HOME=$bamboo_jdk_1_8 \
./grailsw prod maven-deploy --repository=atlassian_nexus_releases -- non-interactive -verbose;

echo 'Incrementing to next snapshot...';
JAVA_HOME=$bamboo_jdk_1_8 \
./grailsw version-update p s --non-interactive;

echo 'Committing and pushing version changes...';
git commit -m 'Increment version to next snapshot' --application.properties;
git push $GIT_URL $GIT_BRANCH;

echo 'Completed bamboo-build-release.sh';

我在上面的构建文件中唯一更改的是添加“-verbose”,这样我可以获得更多关于它失败原因的信息。如上所示,它没有提供有关发布失败原因的更多详细信息。

我验证了生成的 pom 指定了正确的非快照版本:
<?xml version='1.0' encoding='UTF-8'?>
<project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd'>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mydomain</groupId>
<artifactId>myproject-admin</artifactId>
<packaging>war</packaging>
<version>1.11.9</version>
<name>myproject-admin</name>
</project>

请告知我可能正在寻找的导致问题的想法。

最佳答案

虽然我仍然不确定为什么它在发布和快照中一直失败,但以下针对间歇性 ivy-to-nexus-failures 的解决方案对我有用:https://support.sonatype.com/hc/en-us/articles/218101688-Ivy-deploy-fails-intermittently-with-java-io-IOException-Error-writing-to-server-
我最终在 BuildConfig.groovy 文件中添加了以下依赖项:

dependencies{
build 'commons-codec:commons-codec:1.7'
build 'commons-httpclient:commons-httpclient:3.1'
build 'commons-logging:commons-logging:1.1.1'

// other dependencies...
}

关于maven - Grails Release 莫名其妙地无法发布到 Nexus,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55477638/

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