部署到Sonatype Nexus存储库失败,缺少资源。

huangapple go评论90阅读模式
英文:

Deploy to sonatype nexus repo failing with missing resources

问题

以下是翻译好的内容:

我刚刚重新拾起了一年前的一个旧项目,试图将修复部署到 Sonatype Nexus 存储库,但一直遇到我不理解的规则失败。这是在 IntelliJ IDE 中开发的 Maven 项目。

我的错误如下:

[ERROR] Nexus Staging Rules Failure Report
[ERROR] ==================================
[ERROR] 
[ERROR] Repository "comgithubmuseadmin-1055" failures
[ERROR]   Rule "sources-staging" failures
[ERROR]     * 缺失:文件夹 '/com/github/museadmin/infinite-state-machine/1.1.9' 中找不到源代码 jar 包。
[ERROR]   Rule "javadoc-staging" failures
[ERROR]     * 缺失:文件夹 '/com/github/museadmin/infinite-state-machine/1.1.9' 中找不到 Javadoc jar 包。
[ERROR]   Rule "signature-staging" failures
[ERROR]     * 缺失签名:'infinite-state-machine-1.1.9.jar' 的 '/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.jar.asc' 不存在。
[ERROR]     * 缺失签名:'infinite-state-machine-1.1.9.pom' 的 '/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.pom.asc' 不存在。

我猜想它所指的 '/com/xxx' 路径是在我的 .m2 目录下,因为在项目中它并不存在。但是在 '/Users/atkinsb/.m2/repository/com/github/museadmin/infinite-state-machine/1.1.9' 目录下的内容如下:

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

在我继续查看签名错误之前,我想要了解为什么它在存在源代码或 Javadoc jar 包的情况下仍然抱怨。

有哪位 Java 魔法师能够告诉我我做错了什么吗?

谢谢!

Brad

PS:我的 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>

这是完整的日志输出:

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:
...
[ERROR] Rule failure while trying to close staging repository with ID "comgithubmuseadmin-1058".
...
[ERROR] Remote staging finished with a failure: Staging rules failure!
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[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]
...

顺便说一下,我刚刚删除了 .m2 目录下的项目,并执行了 mvn installmvn javadoc:jar,但是 Javadoc jar 包没有被替换。

英文:

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 &quot;comgithubmuseadmin-1055&quot; failures
[ERROR]   Rule &quot;sources-staging&quot; failures
[ERROR]     * Missing: no sources jar found in folder &#39;/com/github/museadmin/infinite-state-machine/1.1.9&#39;
[ERROR]   Rule &quot;javadoc-staging&quot; failures
[ERROR]     * Missing: no javadoc jar found in folder &#39;/com/github/museadmin/infinite-state-machine/1.1.9&#39;
[ERROR]   Rule &quot;signature-staging&quot; failures
[ERROR]     * Missing Signature: &#39;/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.jar.asc&#39; does not exist for &#39;infinite-state-machine-1.1.9.jar&#39;.
[ERROR]     * Missing Signature: &#39;/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.pom.asc&#39; does not exist for &#39;infinite-state-machine-1.1.9.pom&#39;.

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:

&lt;settings xmlns=&quot;http://maven.apache.org/SETTINGS/1.0.0&quot;
          xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
          xsi:schemaLocation=&quot;http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd&quot;&gt;

	&lt;profiles&gt;
    	&lt;profile&gt;
			&lt;id&gt;ossrh&lt;/id&gt;
			&lt;activation&gt;
				&lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
			&lt;/activation&gt;
			&lt;properties&gt;
				&lt;gpg.executable&gt;gpg&lt;/gpg.executable&gt;
				&lt;gpg.passphrase&gt;xxxxxxxxxx&lt;/gpg.passphrase&gt;
			&lt;/properties&gt;
    	&lt;/profile&gt;
	&lt;/profiles&gt;

	&lt;servers&gt;
		&lt;server&gt;
			&lt;id&gt;ossrh&lt;/id&gt;
			&lt;username&gt;steadyonabix&lt;/username&gt;
			&lt;password&gt;xxxxxxx&lt;/password&gt;
		&lt;/server&gt;
	&lt;/servers&gt;

&lt;/settings&gt;

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 &#39;UTF-8&#39; 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 &#39;UTF-8&#39; 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=&quot;/Users/atkinsb/GitRepos/infinite-state-machine/target/nexus-staging/staging&quot;)...
[INFO]  + Using server credentials &quot;ossrh&quot; from Maven settings.
[INFO]  * Connected to Nexus at https://oss.sonatype.org:443/, is version 2.14.16-01 and edition &quot;Professional&quot;
[INFO]  * Using staging profile ID &quot;5958335c79f727&quot; (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 &quot;5958335c79f727&quot;
[INFO]  * Created staging repository with ID &quot;comgithubmuseadmin-1058&quot;.
[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 &quot;comgithubmuseadmin-1058&quot;.
Waiting for operation to complete...
......
[ERROR] Rule failure while trying to close staging repository with ID &quot;comgithubmuseadmin-1058&quot;.
[ERROR] 
[ERROR] Nexus Staging Rules Failure Report
[ERROR] ==================================
[ERROR] 
[ERROR] Repository &quot;comgithubmuseadmin-1058&quot; failures
[ERROR]   Rule &quot;javadoc-staging&quot; failures
[ERROR]     * Missing: no javadoc jar found in folder &#39;/com/github/museadmin/infinite-state-machine/1.1.9&#39;
[ERROR]   Rule &quot;sources-staging&quot; failures
[ERROR]     * Missing: no sources jar found in folder &#39;/com/github/museadmin/infinite-state-machine/1.1.9&#39;
[ERROR]   Rule &quot;signature-staging&quot; failures
[ERROR]     * Missing Signature: &#39;/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.jar.asc&#39; does not exist for &#39;infinite-state-machine-1.1.9.jar&#39;.
[ERROR]     * Missing Signature: &#39;/com/github/museadmin/infinite-state-machine/1.1.9/infinite-state-machine-1.1.9.pom.asc&#39; does not exist for &#39;infinite-state-machine-1.1.9.pom&#39;.
[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 &quot;comgithubmuseadmin-1058&quot; (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! -&gt; [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.

答案1

得分: 2

最后!真是令人沮丧的一天。

我找到了一些我之前放在一边的旧笔记,发现将这个配置文件添加到命令行中是有效的。但我还不太确定为什么会这样……

mvn clean deploy -Pdeploy

感谢大家的帮助。

英文:

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.

huangapple
  • 本文由 发表于 2020年4月4日 00:02:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/61015866.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定