无法编译Eclipse PAHO MQTT Client项目

时间:2014-11-22 10:47:51

标签: java eclipse maven

我遵循以下步骤:

  1. git clone http://git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.java.git
  2. cd org.eclipse.paho.mqtt.java.git
  3. mvn package -DskipTests
  4. 此步骤导致:

    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [ERROR] FATAL ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Error building POM (may not be this project's POM).
    
    
    Project ID: org.eclipse.paho:java-parent
    
    Reason: Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'eclipse-kepler'. for project org.eclipse.paho:java-parent
    
    
    [INFO] ------------------------------------------------------------------------
    [INFO] Trace
    org.apache.maven.reactor.MavenExecutionException: Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'eclipse-kepler'. for project org.eclipse.paho:java-parent
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:404)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:272)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        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:483)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
    Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'eclipse-kepler'. for project org.eclipse.paho:java-parent
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildArtifactRepositories(DefaultMavenProjectBuilder.java:949)
        at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1206)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:823)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:508)
        at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
        at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:604)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:487)
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:391)
        ... 12 more
    Caused by: org.apache.maven.artifact.InvalidRepositoryException: Cannot find layout implementation corresponding to: 'p2' for remote repository with id: 'eclipse-kepler'.
        at org.apache.maven.project.ProjectUtils.getRepositoryLayout(ProjectUtils.java:157)
        at org.apache.maven.project.ProjectUtils.buildArtifactRepository(ProjectUtils.java:110)
        at org.apache.maven.project.ProjectUtils.buildArtifactRepositories(ProjectUtils.java:56)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildArtifactRepositories(DefaultMavenProjectBuilder.java:942)
        ... 19 more
    Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Component descriptor cannot be found in the component repository: org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayoutp2.
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:323)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:440)
        at org.apache.maven.project.ProjectUtils.getRepositoryLayout(ProjectUtils.java:153)
        ... 22 more
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: < 1 second
    [INFO] Finished at: Sat Nov 22 11:37:37 CET 2014
    [INFO] Final Memory: 2M/136M
    [INFO] ------------------------------------------------------------------------
    

    如果删除&#39; eclipse-kepler&#39; pom.xml中的reposiroty会出现其他类型的错误。

    + Error stacktraces are turned on.
    [INFO] Scanning for projects...
    [INFO] Reactor build order: 
    [INFO]   Eclipse Paho
    [INFO]   Unnamed - org.eclipse.paho:org.eclipse.paho.client.mqttv3:eclipse-plugin:1.0.1
    [INFO]   Unnamed - org.eclipse.paho:org.eclipse.paho.client.mqttv3.test:jar:1.0.1
    [INFO]   Unnamed - org.eclipse.paho:org.eclipse.paho.client.eclipse.feature:eclipse-feature:1.0.1
    [INFO]   Unnamed - org.eclipse.paho:org.eclipse.paho.client.eclipse.view:eclipse-plugin:1.0.1
    [INFO]   Paho P2 Repository
    [INFO]   Unnamed - org.eclipse.paho:org.eclipse.paho.mqtt.utility:jar:1.0.1
    [INFO]   Unnamed - org.eclipse.paho:org.eclipse.paho.ui:pom:1.0.1
    [INFO]   Unnamed - org.eclipse.paho:org.eclipse.paho.ui.core:eclipse-plugin:1.0.1
    [INFO]   Unnamed - org.eclipse.paho:org.eclipse.paho.ui.app:eclipse-repository:1.0.1
    [INFO]   Unnamed - org.eclipse.paho:org.eclipse.paho.ui.plugin:pom:1.0.1
    [INFO]   Eclipse Paho - MQTT Android Service
    [INFO]   Unnamed - org.eclipse.paho:org.eclipse.paho.android.service:jar:1.0.1
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Eclipse Paho
    [INFO]    task-segment: [package]
    [INFO] ------------------------------------------------------------------------
    [INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Unnamed - org.eclipse.paho:org.eclipse.paho.client.mqttv3:eclipse-plugin:1.0.1
    [INFO]    task-segment: [package]
    [INFO] ------------------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Internal error in the plugin manager executing goal 'org.eclipse.tycho:tycho-packaging-plugin:0.20.0:build-qualifier': Unable to find the mojo 'build-qualifier' (or one of its required components) in the plugin 'org.eclipse.tycho:tycho-packaging-plugin'
    Component descriptor cannot be found in the component repository: org.codehaus.plexus.logging.Logger.
    [INFO] ------------------------------------------------------------------------
    [INFO] Trace
    org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'org.eclipse.tycho:tycho-packaging-plugin:0.20.0:build-qualifier': Unable to find the mojo 'build-qualifier' (or one of its required components) in the plugin 'org.eclipse.tycho:tycho-packaging-plugin'
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:698)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        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:483)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
    Caused by: org.apache.maven.plugin.PluginManagerException: Unable to find the mojo 'build-qualifier' (or one of its required components) in the plugin 'org.eclipse.tycho:tycho-packaging-plugin'
        at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:674)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:468)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        ... 17 more
    Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Unable to lookup component 'org.apache.maven.plugin.Mojoorg.eclipse.tycho:tycho-packaging-plugin:0.20.0:build-qualifier', it could not be started
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:339)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:440)
        at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:652)
        ... 19 more
    Caused by: org.codehaus.plexus.component.repository.exception.ComponentLifecycleException: Error starting component
        at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:109)
        at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
        at org.codehaus.plexus.component.manager.PerLookupComponentManager.getComponent(PerLookupComponentManager.java:48)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
        ... 21 more
    Caused by: org.codehaus.plexus.personality.plexus.lifecycle.phase.PhaseExecutionException: Error composing component
        at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:33)
        at org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
        at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
        ... 24 more
    Caused by: org.codehaus.plexus.component.composition.CompositionException: Composition failed of field projectTypes in object of type org.eclipse.tycho.buildversion.BuildQualifierMojo because the requirement ComponentRequirement{role='org.eclipse.tycho.core.TychoProject', roleHint='null', fieldName='projectTypes'} was missing
        at org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:154)
        at org.codehaus.plexus.component.composition.FieldComponentComposer.assembleComponent(FieldComponentComposer.java:73)
        at org.codehaus.plexus.component.composition.DefaultComponentComposerManager.assembleComponent(DefaultComponentComposerManager.java:68)
        at org.codehaus.plexus.DefaultPlexusContainer.composeComponent(DefaultPlexusContainer.java:1486)
        at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:29)
        ... 26 more
    Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Unable to lookup component 'org.eclipse.tycho.core.TychoProjecteclipse-test-plugin', it could not be started
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:339)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:440)
        at org.codehaus.plexus.DefaultPlexusContainer.lookupMap(DefaultPlexusContainer.java:390)
        at org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:103)
        ... 30 more
    Caused by: org.codehaus.plexus.component.repository.exception.ComponentLifecycleException: Error starting component
        at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:109)
        at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
        at org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
        ... 33 more
    Caused by: org.codehaus.plexus.personality.plexus.lifecycle.phase.PhaseExecutionException: Error composing component
        at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:33)
        at org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
        at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
        ... 36 more
    Caused by: org.codehaus.plexus.component.composition.CompositionException: Composition failed of field resolver in object of type org.eclipse.tycho.core.osgitools.OsgiTestBundleProject because the requirement ComponentRequirement{role='org.eclipse.tycho.core.osgitools.EquinoxResolver', roleHint='null', fieldName='resolver'} was missing
        at org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:154)
        at org.codehaus.plexus.component.composition.FieldComponentComposer.assembleComponent(FieldComponentComposer.java:73)
        at org.codehaus.plexus.component.composition.DefaultComponentComposerManager.assembleComponent(DefaultComponentComposerManager.java:68)
        at org.codehaus.plexus.DefaultPlexusContainer.composeComponent(DefaultPlexusContainer.java:1486)
        at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:29)
        ... 38 more
    Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Unable to lookup component 'org.eclipse.tycho.core.osgitools.EquinoxResolver', it could not be started
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:339)
        at org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:129)
        ... 42 more
    Caused by: org.codehaus.plexus.component.repository.exception.ComponentLifecycleException: Error starting component
        at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:109)
        at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
        at org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
        ... 43 more
    Caused by: org.codehaus.plexus.personality.plexus.lifecycle.phase.PhaseExecutionException: Error composing component
        at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:33)
        at org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
        at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
        ... 46 more
    Caused by: org.codehaus.plexus.component.composition.CompositionException: Composition failed of field logger in object of type org.eclipse.tycho.core.osgitools.EquinoxResolver because the requirement ComponentRequirement{role='org.codehaus.plexus.logging.Logger', roleHint='null', fieldName='logger'} was missing
        at org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:154)
        at org.codehaus.plexus.component.composition.FieldComponentComposer.assembleComponent(FieldComponentComposer.java:73)
        at org.codehaus.plexus.component.composition.DefaultComponentComposerManager.assembleComponent(DefaultComponentComposerManager.java:68)
        at org.codehaus.plexus.DefaultPlexusContainer.composeComponent(DefaultPlexusContainer.java:1486)
        at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:29)
        ... 48 more
    Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Component descriptor cannot be found in the component repository: org.codehaus.plexus.logging.Logger.
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:323)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:312)
        at org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:129)
        ... 52 more
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1 second
    [INFO] Finished at: Sat Nov 22 11:45:51 CET 2014
    [INFO] Final Memory: 20M/265M
    [INFO] ------------------------------------------------------------------------
    

    有人能帮助我吗?

2 个答案:

答案 0 :(得分:3)

您可以尝试将maven从2.x升级到3.x.

答案 1 :(得分:1)

请注意,在Ubuntu上,&#39; maven&#39;包装比“maven2”更新。包。以下命令为我修复了它:

sudo apt-get remove maven2
sudo apt-get install maven