如何在Jboss Fuse Openshift上使用fabric8进行部署

时间:2014-11-26 19:53:23

标签: maven jboss openshift jbossfuse fabric8

我需要你的帮助!!

我试图在Openshift中的Jboss Fuse上部署我的服务。

我在我的pom.xml中添加了fabric maven插件:

<plugin>
    <groupId>io.fabric8</groupId>
    <artifactId>fabric8-maven-plugin</artifactId>
</plugin>

这是我在./m2上的settings.xml

<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">


  <pluginGroups>
  </pluginGroups>


  <proxies>
  </proxies>


  <servers>
    <!-- SERVER OPENSHIFT JBOSS FUSE -->
    <server>
        <id>openshift</id>
        <username>admin</username>
        <password>xxxxxxxxx</password>
    </server>

    <server>
      <id>fabric8.upload.repo</id>
      <username>admin</username>
      <password>admin</password>
    </server>
  </servers>


  <mirrors>
  </mirrors>



  <profiles>
  </profiles>


</settings>

但是当我部署我的服务时:

$ mvn fabric8:deploy -e

这是错误:

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'io.fabric8:fabric8-maven-plugin:1.2.0.redhat-046:deploy': Unable to load the mojo 'io.fabric8:fabric8-maven-plugin:1.2.0.redhat-046:deploy' in the plugin 'io.fabric8:fabric8-maven-plugin'. A required class is missing: org/apache/maven/repository/legacy/metadata/ArtifactMetadataRetrievalException
org.apache.maven.repository.legacy.metadata.ArtifactMetadataRetrievalException
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'io.fabric8:fabric8-maven-plugin:1.2.0.redhat-046:deploy': Unable to load the mojo 'io.fabric8:fabric8-maven-plugin:1.2.0.redhat-046:deploy' in the plugin 'io.fabric8:fabric8-maven-plugin'. A required class is missing: org/apache/maven/repository/legacy/metadata/ArtifactMetadataRetrievalException
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:698)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
        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:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        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 load the mojo 'io.fabric8:fabric8-maven-plugin:1.2.0.redhat-046:deploy' in the plugin 'io.fabric8:fabric8-maven-plugin'. A required class is missing: org/apache/maven/repository/legacy/metadata/ArtifactMetadataRetrievalException
        at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:669)
        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.Mojoio.fabric8:fabric8-maven-plugin:1.2.0.redhat-046:deploy', 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 artifactCollector in object of type io.fabric8.maven.DeployToProfileMojo because the requirement ComponentRequirement{role='org.apache.maven.artifact.resolver.ArtifactCollector', roleHint='null', fieldName='artifactCollector'} 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.apache.maven.artifact.resolver.ArtifactCollector', it could not be created
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:335)
        at org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:129)
        ... 30 more
Caused by: org.codehaus.plexus.component.factory.ComponentInstantiationException: Could not instanciate component: role: 'org.apache.maven.artifact.resolver.ArtifactCollector', implementation: 'org.apache.maven.artifact.resolver.DefaultArtifactCollector', role hint: 'default'
        at org.codehaus.plexus.component.factory.java.JavaComponentFactory.makeException(JavaComponentFactory.java:77)
        at org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(JavaComponentFactory.java:62)
        at org.codehaus.plexus.DefaultPlexusContainer.createComponentInstance(DefaultPlexusContainer.java:1464)
        at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:93)
        at org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
        ... 31 more
Caused by: java.lang.NoClassDefFoundError: org/apache/maven/repository/legacy/metadata/ArtifactMetadataRetrievalException
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585)
        at java.lang.Class.getConstructor0(Class.java:2885)
        at java.lang.Class.newInstance(Class.java:350)
        at org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(JavaComponentFactory.java:44)
        ... 35 more
Caused by: java.lang.ClassNotFoundException: org.apache.maven.repository.legacy.metadata.ArtifactMetadataRetrievalException
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
        at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
        at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
        at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 40 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4 minutes 20 seconds
[INFO] Finished at: Wed Nov 26 19:51:30 UTC 2014

我可以帮帮我吗? 谢谢!

1 个答案:

答案 0 :(得分:0)

您需要使用Maven 3.1.1或更高版本。不支持旧的Maven 2.x.