Плагин org.апаш.знаток.Плагины:maven-clean-plugin: 2.5 или одна из его зависимостей не может быть решена

у меня есть установка maven в моей машине. Я правильно установил папку class-path и Maven home. Каждый раз, когда я выполняю mvn clean install, это дает мне исключение. Я также попытался удалить .папка м2, но тот же результат.

  • mvn-версия выход

    Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T19:57:37+08:00)
    Maven home: C:maven-3
    Java version: 1.7.0_45, vendor: Oracle Corporation
    Java home: D:jdk170_45jre
    Default locale: en_US, platform encoding: MS950
    OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
    
  • log для mvn-X чистая установка

        Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T19:57:37+08:00)
        Maven home: C:maven-3
        Java version: 1.7.0_45, vendor: Oracle Corporation
        Java home: D:jdk170_45jre
        Default locale: en_US, platform encoding: MS950
        OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
        [DEBUG] Created new class realm maven.api
        [DEBUG] Importing foreign packages into class realm maven.api
        [DEBUG]   Imported: javax.enterprise.inject.* < plexus.core
        [DEBUG]   Imported: javax.enterprise.util.* < plexus.core
        [DEBUG]   Imported: javax.inject.* < plexus.core
        [DEBUG]   Imported: org.apache.maven.* < plexus.core
        [DEBUG]   Imported: org.apache.maven.artifact < plexus.core
        [DEBUG]   Imported: org.apache.maven.classrealm < plexus.core
        [DEBUG]   Imported: org.apache.maven.cli < plexus.core
        [DEBUG]   Imported: org.apache.maven.configuration < plexus.core
        [DEBUG]   Imported: org.apache.maven.exception < plexus.core
        [DEBUG]   Imported: org.apache.maven.execution < plexus.core
        [DEBUG]   Imported: org.apache.maven.execution.scope < plexus.core
        [DEBUG]   Imported: org.apache.maven.lifecycle < plexus.core
        [DEBUG]   Imported: org.apache.maven.model < plexus.core
        [DEBUG]   Imported: org.apache.maven.monitor < plexus.core
        [DEBUG]   Imported: org.apache.maven.plugin < plexus.core
        [DEBUG]   Imported: org.apache.maven.profiles < plexus.core
        [DEBUG]   Imported: org.apache.maven.project < plexus.core
        [DEBUG]   Imported: org.apache.maven.reporting < plexus.core
        [DEBUG]   Imported: org.apache.maven.repository < plexus.core
        [DEBUG]   Imported: org.apache.maven.rtinfo < plexus.core
        [DEBUG]   Imported: org.apache.maven.settings < plexus.core
        [DEBUG]   Imported: org.apache.maven.toolchain < plexus.core
        [DEBUG]   Imported: org.apache.maven.usability < plexus.core
        [DEBUG]   Imported: org.apache.maven.wagon.* < plexus.core
        [DEBUG]   Imported: org.apache.maven.wagon.authentication < plexus.core
        [DEBUG]   Imported: org.apache.maven.wagon.authorization < plexus.core
        [DEBUG]   Imported: org.apache.maven.wagon.events < plexus.core
        [DEBUG]   Imported: org.apache.maven.wagon.observers < plexus.core
        [DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core
        [DEBUG]   Imported: org.apache.maven.wagon.repository < plexus.core
        [DEBUG]   Imported: org.apache.maven.wagon.resource < plexus.core
        [DEBUG]   Imported: org.codehaus.classworlds < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.* < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.classworlds < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.component < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.configuration < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.container < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.context < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.lifecycle < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.logging < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.personality < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.* < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.artifact < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.collection < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.deployment < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.graph < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.impl < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.installation < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.internal.impl < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.metadata < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.repository < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.resolution < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.spi < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.transfer < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.version < plexus.core
        [DEBUG]   Imported: org.slf4j.* < plexus.core
        [DEBUG]   Imported: org.slf4j.spi.* < plexus.core
        [DEBUG] Populating class realm maven.api
        [INFO] Error stacktraces are turned on.
        [DEBUG] Reading global settings from C:maven-3confsettings.xml
        [DEBUG] Reading user settings from C:UsersH1514.m2settings.xml
        [DEBUG] Reading global toolchains from C:maven-3conftoolchains.xml
        [DEBUG] Reading user toolchains from C:UsersH1514.m2toolchains.xml
        [DEBUG] Using local repository at C:UsersH1514.m2repository
        [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for C:UsersH1514.m2repository
        [INFO] Scanning for projects...
        [DEBUG] Extension realms for project camel:camel:jar:0.0.1-SNAPSHOT: (none)
        [DEBUG] Looking up lifecyle mappings for packaging jar from ClassRealm[plexus.core, parent: null]
        [DEBUG] === REACTOR BUILD PLAN ================================================
        [DEBUG] Project: camel:camel:jar:0.0.1-SNAPSHOT
        [DEBUG] Tasks:   [clean, install]
        [DEBUG] Style:   Regular
        [DEBUG] =======================================================================
        [INFO]                                                                         
        [INFO] ------------------------------------------------------------------------
        [INFO] Building camel 0.0.1-SNAPSHOT
        [INFO] ------------------------------------------------------------------------
        [DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
        [DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
        [DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
        [DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
        [DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
        [DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
        [DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repo.maven.apache.org/maven2
        [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo.maven.apache.org/maven2
        Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
    
        [DEBUG] Writing tracking file C:UsersH1514.m2repositoryorgapachemavenpluginsmaven-clean-plugin.5maven-clean-plugin-2.5.pom.lastUpdated
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD FAILURE
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 22.858 s
        [INFO] Finished at: 2015-05-29T14:11:00+08:00
        [INFO] Final Memory: 5M/15M
        [INFO] ------------------------------------------------------------------------
        [ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/23.235.47.215] failed: Connection timed out: connect -> [Help 1]
        org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
            at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:117)
            at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:179)
            at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:298)
            at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:241)
            at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:169)
            at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:155)
            at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:131)
            at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:145)
            at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan(BuilderCommon.java:96)
            at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:109)
            at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
            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:307)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
            at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
            at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
            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)
        Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
            at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:302)
            at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:218)
            at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:287)
            at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:103)
            ... 26 more
        Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/23.235.47.215] failed: Connection timed out: connect
            at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
            at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
            at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
            at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:287)
            ... 29 more
        Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/23.235.47.215] failed: Connection timed out: connect
            at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43)
            at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
            at org.eclipse.aether.util.concurrency.RunnableErrorForwarder.run(RunnableErrorForwarder.java:67)
            at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)
            at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:249)
            at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
            at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
            ... 32 more
        Caused by: org.apache.maven.wagon.TransferFailedException: Connect to repo.maven.apache.org:443 [repo.maven.apache.org/23.235.47.215] failed: Connection timed out: connect
            at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:1066)
            at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:960)
            at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
            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:560)
            at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:427)
            at org.eclipse.aether.transport.wagon.WagonTransporter.get(WagonTransporter.java:404)
            at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:447)
            at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
            ... 37 more
        Caused by: org.apache.maven.wagon.providers.http.httpclient.conn.HttpHostConnectException: Connect to repo.maven.apache.org:443 [repo.maven.apache.org/23.235.47.215] failed: Connection timed out: connect
            at org.apache.maven.wagon.providers.http.httpclient.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:140)
            at org.apache.maven.wagon.providers.http.httpclient.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:318)
            at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
            at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
            at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
            at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec.execute(RetryExec.java:86)
            at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
            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:832)
            at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:983)
            ... 46 more
        Caused by: java.net.ConnectException: Connection timed out: connect
            at java.net.DualStackPlainSocketImpl.connect0(Native Method)
            at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
            at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
            at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
            at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
            at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
            at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
            at java.net.Socket.connect(Socket.java:579)
            at org.apache.maven.wagon.providers.http.httpclient.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:239)
            at org.apache.maven.wagon.providers.http.httpclient.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:123)
            ... 56 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/PluginResolutionException
    

7 ответов


ваш отладочный вывод указывает, что Clean-это первое, что он пытается запустить, поэтому я предполагаю, что он не может загрузить какие-либо плагины из central.

во-первых, посмотрите, можете ли вы загрузить jar плагина непосредственно в веб-браузере: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.jar

Если это работает, то ваш веб-браузер имеет подключение к центральному, но maven этого не делает. Это наводит меня на мысль что ваш веб-браузер использует прокси, который maven не настроен для использования.

настройки прокси-сервера Maven описаны подробно здесь. Чтобы упростить это, немного заполните это (замените протокол / хост / порт значениями из ваших настроек интернета) и поместите его в <settings> тег вашего maven :

<proxies>
  <proxy>
    <id>proxy</id>
    <active>true</active>
    <protocol>http</protocol>
    <host>proxy.example.com</host>
    <port>8080</port>
  </proxy>
</proxies>

я столкнулся с той же проблемой, даже если я работал над своим домашним wifi-соединением, без каких-либо требований к прокси.

мой проект был создан в c:\users\<>\Workspace\Project\

когда я пошел выше местоположения и побежал

mvn чистая установка

я получил ниже ошибки:

[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its de
endencies could not be resolved: Failed to read artifact descriptor for org.apa
he.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.ap
che.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.mave
.apache.org/maven2)

мне потребовался целый день, чтобы попробовать способы и средства, чтобы взломать это, но решение в моем случае было чертовски простым.

я переместил свой проект в non-user определенном месте, в E:\Workspace\Project\

Это сделало чудеса для меня!


возможно, вы забыли указать настройки, которые были в случае со мной.

попробуй:

mvn clean install-s settings_file.в XML


я столкнулся с той же проблемой, но она решается с некоторыми изменениями в setting.xml(.*\apache-maven-3.3.3\apache-maven-3.3.3\conf).

  <proxies>
  <proxy>
    <id>proxy</id>
    <active>true</active>
    <protocol>http</protocol>
    <host>HOSTNAME</host>
    <port>PORT</port>
  </proxy>
</proxies>

просто проверьте имя хоста и порт из настройки IE - > подключения - > настройка LAN - > прокси-сервер

надеюсь, что это также решит вашу проблему:)


ошибка связана с тем, что официальный репозиторий maven недоступен. Это РЕПО (https://repo.maven.apache.org/maven2/) недоступен, поэтому выполните следующие действия:

  1. Сначала удалите /home/user/.папка м2
  2. создать .м2 папка дома пользователя и хранилище

Я столкнулся с аналогичной проблемой. Попробуйте выполнить следующие действия: Вручную удалить .папка м2. Обратитесь к настройкам.xml-файл и проверьте правильность сведений о репозитории, таких как теги id и url. Также убедитесь, что вы подключены к той же сети и проверьте, доступен ли URL-адрес из браузера. И, наконец, держите проекты maven в / home/User/.


Я столкнулся с той же проблемой и был разочарован, чтобы увидеть все варианты, которые я пробовал, и ни один из них не работает,

оказывается, как только вы настроили все правильно, включая настройки.в XML

просто очистите локальную папку репозитория и попробуйте команды mvn. Это мне очень помогло!--6-->

надеюсь, это поможет другим