Почему Nexus Artifact Uploader хранит артефакты в отдельном каталоге? - PullRequest
0 голосов
/ 21 июня 2019

Я хочу опубликовать артефакт для Nexus 3 в проекте Gradle.Из-за требований публиковать из Jenkins вместо публикации gradle, используя плагин build.gradle maven-publish.Я создал и выполнил сценарий JenkinsPipeline, но артефакт jar и pom были разделены. Почему?

На следующий сайт ссылаются на this и this .

https://plugins.jenkins.io/nexus-artifact-uploader

И я создаю сценарий JenkinsPipeline.

следующий сценарий конвейера.

pipeline {
    ...
        stage("publish to nexus") {
            steps {
                script {
                    pom = readMavenPom file: "build/pom.xml";
                    artifactPath = "build/libs/gs-managing-transactions-0.1.0.jar"
                    artifactExists = fileExists artifactPath;
                    if(artifactExists) {
                        nexusArtifactUploader(
                            nexusVersion: NEXUS_VERSION,
                            protocol: NEXUS_PROTOCOL,
                            nexusUrl: NEXUS_URL,
                            groupId: pom.groupId,
                            version: pom.version,
                            repository: NEXUS_REPOSITORY,
                            credentialsId: NEXUS_CREDENTIAL_ID,
                            artifacts: [
                                [artifactId: pom.artifactId, classifier: '', file: artifactPath   , type: pom.packaging],
                                [artifactId: pom.artifactId, classifier: '', file: "build/pom.xml", type: "pom"]
                            ]
                        );

                    } else {
                        error "*** File: ${artifactPath}, could not be found";
                    }
                }
            }
        }
    ...
}

часть журнала выполнения

[Pipeline] nexusArtifactUploader
...
Uploading: http://localhost:7777/repository/maven-snapshots/com/sample/sample-spring-managing-transactions/0.0.1-SNAPSHOT/sample-spring-managing-transactions-0.0.1-20190621.123700-7-debug.jar
...
Uploading artifact gs-managing-transactions-0.1.0.jar completed.
...
Uploading: http://localhost:7777/repository/maven-snapshots/com/sample/sample-spring-managing-transactions/0.0.1-SNAPSHOT/sample-spring-managing-transactions-0.0.1-20190621.123701-8-debug.pom
Uploading artifact pom.xml completed.

Почему хранится отдельный артефакт, такой как «sample-spring-manage-Transactions-0.0.1-20190621.123700-7-debug.jar», «sample-spring-manage-Transactions-0.0.1-20190621.123701-8-debug.pom».

Буду ожидать следующего.

"sample-spring-manage-Transactions-0.0.1-20190621.123700-7-debug.jar" "sample-spring-manage-Transactions-0.0.1-20190621.123701-7-debug.pom "

1 Ответ

0 голосов
/ 26 июня 2019

решена. Я пропустил описание "Загрузка снимков артефактов maven не поддерживается этим плагином". plugins.jenkins.io/nexus-artifact-uploader.

...