Maven deploy -x дает Не удалось развернуть артефакты .... Доступ запрещен: http: // - PullRequest
0 голосов
/ 07 декабря 2018

Я пытаюсь запустить mvn deploy в моем проекте. Я не получаю никаких кодов ошибок, таких как 401,407 и т. Д.

Но в журналах говорится:

Uploading to repo id: dav:http://snapshot repo link//parent-pom/2.0.0.

Тогда выполнение не удалось

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] parent-pom 2.0.0-SNAPSHOT ........... SUCCESS [  9.264 s]
[INFO] project-name-one .................. SUCCESS [  8.086 s]
[INFO] project-name-two ..................... SUCCESS [ 37.332 s]
[INFO] project-name-three ...................... SUCCESS [ 20.625 s]
[INFO] project-name-four 2.0.0-SNAPSHOT ... FAILURE [ 19.265 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:35 min
[INFO] Finished at: 2018-12-06T21:55:07-06:00
[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project project-name-four: Failed to deploy artifacts: Could not transfer artifact project.groupid:project-name-one:pom:2.0.0-20181207.035505-1 from/to [repo id] (dav:http://repo/main/snapshot-repo): Access denied to: http://repo/main/snapshot-repo/project/group/id/project-name-one/2.0.0-SNAPSHOT/project-name-one-2.0.0-20181207.035505-1.pom -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project project-name-four: Failed todeploy artifacts: Could not transfer artifact project.groupid:project-name-one:pom:2.0.0-20181207.035505-1 from/to [repo id] (dav:http://repo/main/snapshot-repo): Access denied to: http://repo/main/snapshot-repo/project/group/id/project-name-one/2.0.0-SNAPSHOT/project-name-one-2.0.0-20181207.035505-1.pom
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to deploy artifacts: Could not transfer artifact project.groupid:project-name-one:pom:2.0.0-20181207.035505-1 from/to [repo id] (dav:http://repo/main/snapshot-repo): Access denied to: http://repo/main/snapshot-repo/project/group/id/project-name-one/2.0.0-SNAPSHOT/project-name-one-2.0.0-20181207.035505-1.pom
    at org.apache.maven.plugin.deploy.DeployMojo.deployProject (DeployMojo.java:284)
    at org.apache.maven.plugin.deploy.DeployMojo.execute (DeployMojo.java:185)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact project.groupid:project-name-one:pom:2.0.0-20181207.035505-1 from/to [repo id] (dav:http://repo/main/snapshot-repo): Access denied to: http://repo/main/snapshot-repo/project/group/id/project-name-one/2.0.0-SNAPSHOT/project-name-one-2.0.0-20181207.035505-1.pom
    at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy (DefaultArtifactDeployer.java:146)
    at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy (AbstractDeployMojo.java:171)
    at org.apache.maven.plugin.deploy.DeployMojo.deployProject (DeployMojo.java:242)
    at org.apache.maven.plugin.deploy.DeployMojo.execute (DeployMojo.java:185)
.
.
.
.

Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact project.groupid:project-name-one:pom:2.0.0-20181207.035505-1 from/to [repo id] (dav:http://repo/main/snapshot-repo): Access denied to: http://repo/main/snapshot-repo/project/group/id/project-name-one/2.0.0-SNAPSHOT/project-name-one-2.0.0-20181207.035505-1.pom
    at org.eclipse.aether.internal.impl.DefaultDeployer.deploy (DefaultDeployer.java:295)
    at org.eclipse.aether.internal.impl.DefaultDeployer.deploy (DefaultDeployer.java:223)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy (DefaultRepositorySystem.java:384)
    at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy (DefaultArtifactDeployer.java:142)
    at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy (AbstractDeployMojo.java:171)
    at org.apache.maven.plugin.deploy.DeployMojo.deployProject (DeployMojo.java:242)
.
.
.
.

Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact project.groupid:project-name-one:pom:2.0.0-20181207.035505-1 from/to [repo id] (dav:http://repo/main/snapshot-repo): Access denied to: http://repo/main/snapshot-repo/project/group/id/project-name-one/2.0.0-SNAPSHOT/project-name-one-2.0.0-20181207.035505-1.pom
    at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed (ArtifactTransportListener.java:52)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run (BasicRepositoryConnector.java:365)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector.put (BasicRepositoryConnector.java:284)
    at org.eclipse.aether.internal.impl.DefaultDeployer.deploy (DefaultDeployer.java:289)
.
.
.
.
Caused by: org.apache.maven.wagon.authorization.AuthorizationException: Access denied to: http://repo/main/snapshot-repo/project/group/id/project-name-one/2.0.0-SNAPSHOT/project-name-one-2.0.0-20181207.035505-1.pom
    at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put (AbstractHttpClientWagon.java:409)
    at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put (AbstractHttpClientWagon.java:336)
    at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put (AbstractHttpClientWagon.java:303)

.,,,[ОШИБКА] [ОШИБКА] [ОШИБКА] Для получения дополнительной информации об ошибках и возможных решениях, пожалуйста, прочитайте следующие статьи: [ОШИБКА] [Справка 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ОШИБКА] [ОШИБКА] После устранения проблем выможно возобновить сборку с помощью команды [ОШИБКА] mvn -rf: имя-проекта-три

Я попытался проверить settings.xml и управление распределением pom. Так как это не генерация какого-либо кода ошибки, я не смог 'Т цифра код точная проблема

1 Ответ

0 голосов
/ 07 декабря 2018

Может быть одна из двух вещей, происходящих на основе кодов состояния 401 и 407. В случае 401 сервер артефактов (Nexus) требует авторизации и аутентификации для публикации артефактов.В этом случае вам необходимо указать требуемое имя пользователя и пароль.Это можно сделать в файле ~ / .m2 / settings.xml, добавив что-то похожее на это:

<servers>
  <server>
    <id>dav:http://snapshot</div>
    <username>youruser</username>
    <password>yourpass</password>
  </server>
</servers

Код ошибки 407 указывает на совершенно другую проблему.Обычно это означает, что у вас есть прокси-сервер между вами и сервером артефактов, который требует входа в систему.Обычно это можно решить, добавив конфигурацию прокси в файл settings.xml с необходимыми именем пользователя и паролем.См. Образец ниже для шаблона.

<proxies>
    <!-- proxy
 | Specification for one proxy, to be used in connecting to the network.
 |
<proxy>
  <id>optional</id>
  <active>true</active>
  <protocol>http</protocol>
  <username>proxyuser</username>
  <password>proxypass</password>
  <host>proxy.host.net</host>
  <port>80</port>
  <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
-->
</proxies>
...