Maven正在寻找settings.xml或pom.xml中不存在的存储库

时间:2018-08-24 15:39:15

标签: java maven intellij-idea pom.xml maven-jetty-plugin

我正在使用Intellij进行此Maven Web项目。 Apache Maven已手动安装在计算机中,并且settings.xml为空。

我的pom.xml看起来像这样:

<repositories>
    <repository>
        <id>abc-nexus</id>
        <url>http://abc:9090/nexus/content/groups/public</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
        <releases>
            <enabled>true</enabled>
        </releases>
    </repository>
</repositories>

我用这个做mvn软件包:

-e -Dmaven.repo.local=E:/svn-source-codes/MyConnectorProject/local_maven_repository package

我使用以下命令进行mvn安装:

-e -Dmaven.repo.local=E:/svn-source-codes/MyConnectorProject/local_maven_repository install

但是,当我仍然尝试使用jetty:run运行此生成的战争文件时,它仍从某个未知网站下载了jar文件,日志看起来像这样:

[INFO] --- maven-jetty-plugin:1.0.4:run-war (default-cli) @ crystal-assembly ---
Downloading: http://WrongAppServer:8081/nexus/content/groups/public/org/apache/maven/maven-settings/2.0.3/maven-settings-2.0.3.jar
Downloading: http://WrongAppServer:8081/nexus/content/groups/public/org/apache/maven/maven-model/2.0.3/maven-model-2.0.3.jar
Downloading: http://WrongAppServer:8081/nexus/content/groups/public/org/apache/maven/maven-project/2.0.3/maven-project-2.0.3.jar
Downloading: http://WrongAppServer:8081/nexus/content/groups/public/org/apache/maven/maven-artifact-manager/2.0.3/maven-artifact-manager-2.0.3.jar
Downloading: http://WrongAppServer:8081/nexus/content/groups/public/org/apache/maven/maven-profile/2.0.3/maven-profile-2.0.3.jar
Downloading: http://WrongAppServer:8081/nexus/content/groups/public/org/apache/maven/maven-repository-metadata/2.0.3/maven-repository-metadata-2.0.3.jar
Downloading: http://WrongAppServer:8081/nexus/content/groups/public/org/apache/maven/maven-plugin-api/2.0.3/maven-plugin-api-2.0.3.jar
Downloading: http://WrongAppServer:8081/nexus/content/groups/public/org/apache/maven/maven-artifact/2.0.3/maven-artifact-2.0.3.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0.3/maven-project-2.0.3.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/2.0.3/maven-settings-2.0.3.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.0.3/maven-profile-2.0.3.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0.3/maven-model-2.0.3.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.0.3/maven-artifact-manager-2.0.3.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.0.3/maven-repository-metadata-2.0.3.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.3/maven-plugin-api-2.0.3.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.3/maven-artifact-2.0.3.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 49.993 s
[INFO] Finished at: 2018-08-24T17:23:16+02:00
[INFO] Final Memory: 19M/46M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.MyProjectName.maven.plugin:maven-jetty-plugin:1.0.4:run-war (default-cli) on project crystal-assembly: Execution default-cli of goal com.MyProjectName.maven.plugin:maven-jetty-plugin:1.0.4:run-war failed: Plugin com.MyProjectName.maven.plugin:maven-jetty-plugin:1.0.4 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-project:jar:2.0.3, org.apache.maven:maven-settings:jar:2.0.3, org.apache.maven:maven-profile:jar:2.0.3, org.apache.maven:maven-model:jar:2.0.3, org.apache.maven:maven-artifact-manager:jar:2.0.3, org.apache.maven:maven-repository-metadata:jar:2.0.3, org.apache.maven:maven-plugin-api:jar:2.0.3, org.apache.maven:maven-artifact:jar:2.0.3: Could not transfer artifact org.apache.maven:maven-project:jar:2.0.3 from/to MyProjectName-nexus-public (http://WrongAppServer:8081/nexus/content/groups/public): WrongAppServer: Unknown host WrongAppServer -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.MyProjectName.maven.plugin:maven-jetty-plugin:1.0.4:run-war (default-cli) on project crystal-assembly: Execution default-cli of goal com.MyProjectName.maven.plugin:maven-jetty-plugin:1.0.4:run-war failed: Plugin com.MyProjectName.maven.plugin:maven-jetty-plugin:1.0.4 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-project:jar:2.0.3, org.apache.maven:maven-settings:jar:2.0.3, org.apache.maven:maven-profile:jar:2.0.3, org.apache.maven:maven-model:jar:2.0.3, org.apache.maven:maven-artifact-manager:jar:2.0.3, org.apache.maven:maven-repository-metadata:jar:2.0.3, org.apache.maven:maven-plugin-api:jar:2.0.3, org.apache.maven:maven-artifact:jar:2.0.3: Could not transfer artifact org.apache.maven:maven-project:jar:2.0.3 from/to MyProjectName-nexus-public (http://WrongAppServer:8081/nexus/content/groups/public): WrongAppServer
    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:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    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)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.intellij.rt.execution.application.AppMainV2.main(AppMainV2.java:131)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal com.MyProjectName.maven.plugin:maven-jetty-plugin:1.0.4:run-war failed: Plugin com.MyProjectName.maven.plugin:maven-jetty-plugin:1.0.4 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-project:jar:2.0.3, org.apache.maven:maven-settings:jar:2.0.3, org.apache.maven:maven-profile:jar:2.0.3, org.apache.maven:maven-model:jar:2.0.3, org.apache.maven:maven-artifact-manager:jar:2.0.3, org.apache.maven:maven-repository-metadata:jar:2.0.3, org.apache.maven:maven-plugin-api:jar:2.0.3, org.apache.maven:maven-artifact:jar:2.0.3: Could not transfer artifact org.apache.maven:maven-project:jar:2.0.3 from/to MyProjectName-nexus-public (http://WrongAppServer:8081/nexus/content/groups/public): WrongAppServer
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 26 more
Caused by: org.apache.maven.plugin.PluginResolutionException: Plugin com.MyProjectName.maven.plugin:maven-jetty-plugin:1.0.4 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-project:jar:2.0.3, org.apache.maven:maven-settings:jar:2.0.3, org.apache.maven:maven-profile:jar:2.0.3, org.apache.maven:maven-model:jar:2.0.3, org.apache.maven:maven-artifact-manager:jar:2.0.3, org.apache.maven:maven-repository-metadata:jar:2.0.3, org.apache.maven:maven-plugin-api:jar:2.0.3, org.apache.maven:maven-artifact:jar:2.0.3: Could not transfer artifact org.apache.maven:maven-project:jar:2.0.3 from/to MyProjectName-nexus-public (http://WrongAppServer:8081/nexus/content/groups/public): WrongAppServer
    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolveInternal(DefaultPluginDependenciesResolver.java:218)
    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:149)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.createPluginRealm(DefaultMavenPluginManager.java:402)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.setupPluginRealm(DefaultMavenPluginManager.java:374)
    at org.apache.maven.plugin.DefaultBuildPluginManager.getPluginRealm(DefaultBuildPluginManager.java:231)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:102)
    ... 27 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: The following artifacts could not be resolved: org.apache.maven:maven-project:jar:2.0.3, org.apache.maven:maven-settings:jar:2.0.3, org.apache.maven:maven-profile:jar:2.0.3, org.apache.maven:maven-model:jar:2.0.3, org.apache.maven:maven-artifact-manager:jar:2.0.3, org.apache.maven:maven-repository-metadata:jar:2.0.3, org.apache.maven:maven-plugin-api:jar:2.0.3, org.apache.maven:maven-artifact:jar:2.0.3: Could not transfer artifact org.apache.maven:maven-project:jar:2.0.3 from/to MyProjectName-nexus-public (http://WrongAppServer:8081/nexus/content/groups/public): WrongAppServer
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:453)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:255)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:376)
    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolveInternal(DefaultPluginDependenciesResolver.java:210)
    ... 32 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.maven:maven-project:jar:2.0.3 from/to MyProjectName-nexus-public (http://WrongAppServer:8081/nexus/content/groups/public): WrongAppServer
    at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:52)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:364)
    at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:76)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.wagon.TransferFailedException: WrongAppServer
    at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:1068)
    at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:962)
    at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:126)
    at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
    at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
    at org.eclipse.aether.transport.wagon.WagonTransporter$GetTaskRunner.run(WagonTransporter.java:569)
    at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:436)
    at org.eclipse.aether.transport.wagon.WagonTransporter.get(WagonTransporter.java:413)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:456)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:359)
    ... 4 more
Caused by: java.net.UnknownHostException: WrongAppServer
    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
    at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1295)
    at java.net.InetAddress.getAllByName0(InetAddress.java:1248)
    at java.net.InetAddress.getAllByName(InetAddress.java:1164)
    at java.net.InetAddress.getAllByName(InetAddress.java:1098)
    at org.apache.maven.wagon.providers.http.httpclient.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
    at org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:111)
    at org.apache.maven.wagon.providers.http.httpclient.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
    at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
    at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
    at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
    at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec.execute(RetryExec.java:88)
    at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.maven.wagon.providers.http.httpclient.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.maven.wagon.providers.http.httpclient.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.execute(AbstractHttpClientWagon.java:834)
    at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:985)
    ... 13 more

很显然,它尝试访问的存储库不存在(我手动尝试过)。我知道可以在pom.xml或settings.xml中设置存储库。 但是,我找不到对该WrongAppServer的任何引用。 有人可以帮忙吗?

谢谢!

0 个答案:

没有答案