未能部署文物:找不到神器(Failed to deploy artifacts: Could not

2019-08-31 13:34发布

我想一个库部署到我公司远程仓库。

这是我第一次要部署的库项目到远程仓库。

我收到以下错误信息:

org.sonatype.aether.transfer.ArtifactNotFoundException:无法找到神器com.http:httpkit:罐子:0.0.1在internal.repo( http://jenkins.internal.com/ )

也许我理解的东西完全错误,但错误消息称,在远程存储库中不存在,我尝试部署首次神器。 所以当然没有这样的神器。 为什么行家会尝试当我尝试上传神器获取神器?

我的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.0http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>com.http</groupId>
<artifactId>httpkit</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>
<name>httpkit</name>

<properties>
    <platform.version> 4.1.1.4</platform.version>
</properties>

<dependencies>
    <dependency>
        <groupId>com.google.android</groupId>
        <artifactId>android</artifactId>
        <version>${platform.version}</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

<!-- Deploy to internal maven repository -->
<distributionManagement>
    <repository>
      <id>internal.repo</id>
      <name>Internal Repository</name>
      <url>http://jenkins.internal.com/</url>
    </repository>
</distributionManagement>

<build>
    <plugins>
        <plugin>
            <groupId>com.jayway.maven.plugins.android.generation2</groupId>
            <artifactId>android-maven-plugin</artifactId>
            <version>3.5.3</version>
            <configuration>
                <androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
                <assetsDirectory>${project.basedir}/assets</assetsDirectory>
                <resourceDirectory>${project.basedir}/res</resourceDirectory>
                <nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
                <sdk>
                    <platform>16</platform>
                </sdk>
               <undeployBeforeDeploy>true</undeployBeforeDeploy>
            </configuration>
            <extensions>true</extensions>
        </plugin>

        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
                <source>1.5</source>
                <target>1.5</target>
            </configuration>
        </plugin>

    </plugins>
</build>
</project>

我打电话

MVN部署

从命令行

任何建议如何解决这个问题?

编辑:故障日志(运行mvn deploy -X

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project httpkit: Failed to deploy artifacts: Could not find artifact com.http:httpkit:jar:0.0.1 in internal.repo (http://jenkins.internal.com) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project httpkit: Failed to deploy artifacts: Could not find artifact com.http:httpkit:jar:0.0.1 in internal.repo (http://jenkins.internal.com)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to deploy artifacts: Could not find artifact com.http:httpkit:jar:0.0.1 in internal.repo (http://jenkins.internal.com)
    at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:193)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not find artifact com.http:httpkit:jar:0.0.1 in internal.repo (http://jenkins.internal.com)
    at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:141)
    at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:167)
    at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:157)
    ... 21 more
Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not find artifact com.http:httpkit:jar:0.0.1 in internal.repo (http://jenkins.internal.com)
    at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:280)
    at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:211)
    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:443)
    at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137)
    ... 23 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact com.http:httpkit:jar:0.0.1 in internal.repo (http://jenkins.internal.com/)
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:947)
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:941)
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:837)
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:467)
    at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:274)
    ... 26 more
[ERROR] 
[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

Answer 1:

你有没有尝试添加服务器在你的settings.xml文件? 默认设置的XML位于你的〜/ .m2目录/目录。 应包含类似的东西:

<servers>
        <server>
            <id>my-internal-nexus-repo</id>
            <username>yourUserName</username>
            <password>yourPassword</password>
        </server>
</servers>

下面是该链接http://maven.apache.org/settings.html行家文档添加服务器。

这可能是在黑暗中拍摄另一件事。 我注意到你正在试图连接到什么网址暗示可能是詹金斯实例。 詹金斯是Continious集成服务器,似乎很奇怪,我说你在那里找到你的资料库。 我希望一台Nexus网址什么的。



Answer 2:

(添加,希望它可以帮助谁用Google寻求帮助的人一晚的答案...)

我有这个问题为好。 的头发拉了很多(非常多),我意识到我只是拼错仓库名!

因此,使用OP的例子:

Failed to deploy artifacts: Could not find artifact com.http:httpkit:jar:0.0.1 in internal.
repo (http://jenkins.intrnal.com)

实际上可能意味着

Failed to deploy artifacts: Could not find internal.repo (http://jenkins.intrnal.com)


Answer 3:

我遇到了类似的问题,要解决

  1. 加入我的Nexus服务器的settings.xml中的一个nonProxyHost
  2. 设置第三方的库政策放开,而不是快照。

看到我更多的细节计算器的答案 。

请注意,我在做一个“MVN部署:部署文件”(其上传第三方神器来共享资源库),而你正在做一个“MVN部署”(其上传你的神器从建项目共享资源库),但根本原因也许是相同的。



Answer 4:

在我的情况在pom.xml中的snapshotRepository节我的服务器的URL是指向http,而我的内部存储库是在HTTPS主办。



Answer 5:

好了...我遇到了同样的问题,前几天。 和摆弄周围所有类型的排列和组合后,我终于得出的结论。 这些谁说,反应堆自动排序,并解决自身所有的依赖是不正确的。 看来,下面的链接描述了这一切。 请看看下的“堆排序”一节的最后一点:

https://maven.apache.org/guides/mini/guide-multiple-modules.html#Reactor_Sorting

这表明,在该模块中定义的顺序考虑到当没有其他规则适用。

我希望帮助其他。 :)



文章来源: Failed to deploy artifacts: Could not find artifact