0

我正在尝试让 xldeploy-maven 插件生成导入到 deployit 所需的 dar 文件。但是执行 maven build 命令会出现以下错误。

    [WARNING] Error injecting: com.xebialabs.deployit.maven.GenerateDeploymentPackageMojo
java.lang.NoClassDefFoundError: com/google/common/base/Function
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
        at java.lang.Class.getDeclaredConstructors(Class.java:2020)
        at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
        at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:99)
        at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:658)
        at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:882)
        at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805)
        at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282)
        at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214)
        at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:1006)
        at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1038)
        at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1001)
        at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
        at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
        at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
        at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
        at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:65)
        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
        at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
        at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)
        at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
        at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
        at org.eclipse.sisu.inject.Guice4$1.get(Guice4.java:162)
        at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
        at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:519)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:121)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        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:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        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: java.lang.ClassNotFoundException: com.google.common.base.Function
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
        ... 54 more

xldeploy-maven-plugin 最新版本是 6.0.0 并且正在使用相同的版本。我的 maven pom 配置如下。

    <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.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.org.web.helloworld</groupId>
  <artifactId>helleworld</artifactId>
  <packaging>pom</packaging>
  <version>2.0</version>
  <name>helleworld Maven Webapp</name>
  <url>http://maven.apache.org</url>


    <build>
    <finalName>helleworld</finalName>
    <plugins>
    <plugin>
        <groupId>com.xebialabs.xldeploy</groupId>
        <artifactId>xldeploy-maven-plugin</artifactId>
        <version>6.0.0</version>
        <extensions>true</extensions> 
        <executions>
        <execution>
            <id>DeployIT</id>
            <goals>
                <goal>generate-deployment-package</goal>
            </goals>
        </execution>
        </executions>
    </plugin>
    </plugins>
    </build>

<distributionManagement>
    <repository>
      <id>nexus</id>
      <name>Releases</name>
      <url>https://server.int.org.com/repository/maven-releases</url>
    </repository>
    <snapshotRepository>
      <id>nexus</id>
      <name>Snapshot</name>
      <url>https://server.int.org.com/repository/maven-snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <artifactId>guava</artifactId>
        <groupId>com.google.guava</groupId>
        <type>jar</type>
        <version>15.0</version>
    </dependency>
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>22.0</version>
        <type>jar</type>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.xebialabs.deployit/udm-plugin-api -->
<dependency>
    <groupId>com.xebialabs.deployit</groupId>
    <artifactId>udm-plugin-api</artifactId>
    <version>2017.5.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.xebialabs.deployit.engine/remote-booter -->
<dependency>
    <groupId>com.xebialabs.deployit.engine</groupId>
    <artifactId>remote-booter</artifactId>
    <version>2017.5.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.xebialabs.overthere/overthere -->
<dependency>
    <groupId>com.xebialabs.overthere</groupId>
    <artifactId>overthere</artifactId>
    <version>5.0.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.xebialabs.deployit.engine/engine-xml -->
<dependency>
    <groupId>com.xebialabs.deployit.engine</groupId>
    <artifactId>engine-xml</artifactId>
    <version>2017.5.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.xebialabs.deployit/engine-api -->
<dependency>
    <groupId>com.xebialabs.deployit</groupId>
    <artifactId>engine-api</artifactId>
    <version>2017.5.0</version>
</dependency>


        </dependencies>
  </project>

我不确定是什么导致了这个错误。我已经下载了所有依赖项,但我仍然面临同样的错误。

4

1 回答 1

0

我不确定为什么您的配置中有所有这些依赖项?但我认为他们不应该在那里。使用以下插件存储库时不应该只工作吗?

<pluginRepository>
        <id>xebialabs-maven2</id>
        <url>https://dist.xebialabs.com/public/maven2/</url>
</pluginRepository>
于 2017-09-25T17:25:03.463 回答