简体   繁体   中英

Deploy to sonatype nexus repo failing with missing resources

I've just dusted off an old project I was working on a year ago and am trying to deploy a fix to the Sonatpye Nexus repo but keep hitting rule failures I don't understand. This is a Maven project developed in IntelliJ IDE.

My errors are:

[ERROR] Nexus Staging Rules Failure Report
[ERROR] ==================================
[ERROR] 
[ERROR] Repository "comgithubmuseadmin-1055" failures
[ERROR]   Rule "sources-staging" failures
[ERROR]     * Missing: no sources jar found in folder '/com/github/museadmin/infinite-state-machine/1.1.9'
[ERROR]   Rule "javadoc-staging" failures
[ERROR]     * Missing: no javadoc jar found in folder '/com/github/museadmin/infinite-state-machine/1.1.9'
[ERROR]   Rule "signature-staging" failures
[ERROR]     * Missing Signature: '/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.jar.asc' does not exist for 'infinite-state-machine-1.1.9.jar'.
[ERROR]     * Missing Signature: '/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.pom.asc' does not exist for 'infinite-state-machine-1.1.9.pom'.

I'm assuming the /com/xxx path it's referring to is under my.m2 directory, as it doesn't exist in the project. But the contents of that directory under /Users/atkinsb/.m2/repository/com/github/museadmin/infinite-state-machine/1.1.9 are:

Bradleys-MacBook-Pro:1.1.9 atkinsb$ ll
total 624
-rw-r--r--  1 atkinsb  staff     461  3 Apr 16:31 _remote.repositories
-rw-r--r--  1 atkinsb  staff   40624  3 Apr 13:53 infinite-state-machine-1.1.9-javadoc.jar
-rw-r--r--  1 atkinsb  staff     473  3 Apr 13:54 infinite-state-machine-1.1.9-javadoc.jar.asc
-rw-r--r--  1 atkinsb  staff  121951  3 Apr 13:53 infinite-state-machine-1.1.9-sources.jar
-rw-r--r--  1 atkinsb  staff     473  3 Apr 13:54 infinite-state-machine-1.1.9-sources.jar.asc
-rw-r--r--  1 atkinsb  staff  123349  3 Apr 16:29 infinite-state-machine-1.1.9.jar
-rw-r--r--  1 atkinsb  staff     473  3 Apr 13:53 infinite-state-machine-1.1.9.jar.asc
-rw-r--r--  1 atkinsb  staff    3360  3 Apr 13:35 infinite-state-machine-1.1.9.pom
-rw-r--r--  1 atkinsb  staff     473  3 Apr 13:53 infinite-state-machine-1.1.9.pom.asc

Before I go on to look at the signature errors, I'd like to understand why it is complaining about no sources or java docs jars when it looks like they are there.

Any Java wizards able to enlighten me as to what I'm doing wrong?

Cheers

Brad

PS My settings.xml:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

    <profiles>
        <profile>
            <id>ossrh</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <gpg.executable>gpg</gpg.executable>
                <gpg.passphrase>xxxxxxxxxx</gpg.passphrase>
            </properties>
        </profile>
    </profiles>

    <servers>
        <server>
            <id>ossrh</id>
            <username>steadyonabix</username>
            <password>xxxxxxx</password>
        </server>
    </servers>

</settings>

This is the full log output:

Bradleys-MacBook-Pro:infinite-state-machine atkinsb$ mvn deploy
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO]   ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building com.github.museadmin:infinite-state-machine 1.1.9
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ infinite-state-machine ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 7 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ infinite-state-machine ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ infinite-state-machine ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/atkinsb/GitRepos/infinite-state-machine/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ infinite-state-machine ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ infinite-state-machine ---
[INFO] Surefire report directory: /Users/atkinsb/GitRepos/infinite-state-machine/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.github.museadmin.infinite_state_machine.unit.tests.core.TestMessagingFramework
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#noProviders for further details.
SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions prior to 1.8.
SLF4J: Ignoring binding found at [jar:file:/Users/atkinsb/.m2/repository/ch/qos/logback/logback-classic/1.1.2/logback-classic-1.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#ignoredBindings for an explanation.
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.173 sec
Running com.github.museadmin.infinite_state_machine.unit.tests.core.TestInfiniteStateMachine
NO ACTIONS IMPORTED
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.073 sec
Running com.github.museadmin.infinite_state_machine.unit.tests.core.TestPropertyCache
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec

Results :

Tests run: 8, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ infinite-state-machine ---
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ infinite-state-machine ---
[INFO] Installing /Users/atkinsb/GitRepos/infinite-state-machine/target/infinite-state-machine-1.1.9.jar to /Users/atkinsb/.m2/repository/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.jar
[INFO] Installing /Users/atkinsb/GitRepos/infinite-state-machine/pom.xml to /Users/atkinsb/.m2/repository/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.pom
[INFO] 
[INFO] --- nexus-staging-maven-plugin:1.6.8:deploy (injected-nexus-deploy) @ infinite-state-machine ---
[INFO] Performing local staging (local stagingDirectory="/Users/atkinsb/GitRepos/infinite-state-machine/target/nexus-staging/staging")...
[INFO]  + Using server credentials "ossrh" from Maven settings.
[INFO]  * Connected to Nexus at https://oss.sonatype.org:443/, is version 2.14.16-01 and edition "Professional"
[INFO]  * Using staging profile ID "5958335c79f727" (matched by Nexus).
[INFO] Installing /Users/atkinsb/GitRepos/infinite-state-machine/target/infinite-state-machine-1.1.9.jar to /Users/atkinsb/GitRepos/infinite-state-machine/target/nexus-staging/staging/5958335c79f727/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.jar
[INFO] Installing /Users/atkinsb/GitRepos/infinite-state-machine/pom.xml to /Users/atkinsb/GitRepos/infinite-state-machine/target/nexus-staging/staging/5958335c79f727/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.pom
[INFO] Performing remote staging...
[INFO] 
[INFO]  * Remote staging into staging profile ID "5958335c79f727"
[INFO]  * Created staging repository with ID "comgithubmuseadmin-1058".
[INFO]  * Staging repository at https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/comgithubmuseadmin-1058
[INFO]  * Uploading locally staged artifacts to profile com.github.museadmin
Uploading: https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/comgithubmuseadmin-1058/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.jar
Uploaded: https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/comgithubmuseadmin-1058/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.jar (121 KB at 94.4 KB/sec)
Uploading: https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/comgithubmuseadmin-1058/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.pom
Uploaded: https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/comgithubmuseadmin-1058/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.pom (4 KB at 8.3 KB/sec)
Downloading: https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/comgithubmuseadmin-1058/com/github/museadmin/infinite-state-machine/maven-metadata.xml
Uploading: https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/comgithubmuseadmin-1058/com/github/museadmin/infinite-state-machine/maven-metadata.xml
Uploaded: https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/comgithubmuseadmin-1058/com/github/museadmin/infinite-state-machine/maven-metadata.xml (322 B at 0.5 KB/sec)
[INFO]  * Upload of locally staged artifacts finished.
[INFO]  * Closing staging repository with ID "comgithubmuseadmin-1058".

Waiting for operation to complete...
......

[ERROR] Rule failure while trying to close staging repository with ID "comgithubmuseadmin-1058".
[ERROR] 
[ERROR] Nexus Staging Rules Failure Report
[ERROR] ==================================
[ERROR] 
[ERROR] Repository "comgithubmuseadmin-1058" failures
[ERROR]   Rule "javadoc-staging" failures
[ERROR]     * Missing: no javadoc jar found in folder '/com/github/museadmin/infinite-state-machine/1.1.9'
[ERROR]   Rule "sources-staging" failures
[ERROR]     * Missing: no sources jar found in folder '/com/github/museadmin/infinite-state-machine/1.1.9'
[ERROR]   Rule "signature-staging" failures
[ERROR]     * Missing Signature: '/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.jar.asc' does not exist for 'infinite-state-machine-1.1.9.jar'.
[ERROR]     * Missing Signature: '/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.pom.asc' does not exist for 'infinite-state-machine-1.1.9.pom'.
[ERROR] 
[ERROR] 
[ERROR] Cleaning up local stage directory after a Rule failure during close of staging repositories: [comgithubmuseadmin-1058]
[ERROR]  * Deleting context 5958335c79f727.properties
[ERROR] Cleaning up remote stage repositories after a Rule failure during close of staging repositories: [comgithubmuseadmin-1058]
[ERROR]  * Dropping failed staging repository with ID "comgithubmuseadmin-1058" (Rule failure during close of staging repositories: [comgithubmuseadmin-1058]).

Waiting for operation to complete...
...

[ERROR] Remote staging finished with a failure: Staging rules failure!
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 55.331 s
[INFO] Finished at: 2020-04-03T19:12:13+01:00
[INFO] Final Memory: 31M/340M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy (injected-nexus-deploy) on project infinite-state-machine: Remote staging failed: Staging rules failure! -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

By the way, I've just deleted the project under my.m2 directory ad done another man install and man javadoc:jar but the javadoc jar hasn't been replaced there.

Finally. What a frustrating day.

I discovered some old notes I had set aside and found that adding this profile to the command line worked. Still not sure why...

mvn clean deploy -Pdeploy

Thanks for the help folks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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