当前位置: 首页 > 知识库问答 >
问题:

未能在项目上执行目标org.codehaus.mojo:apt-maven-plugin:1.0-alpha-5:process(默认):Apt失败

薛欣荣
2023-03-14

我们在goal org.codehaus.mojo:apt-maven-plugin:1.0-alpha-5上的构建有问题

我尝试了以下方法,从无法使用MAVEN构建到错误-未能执行goal org.apache.MAVEN.plugins:maven-compiler-plugin:3.1:compile

插件:

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>apt-maven-plugin</artifactId>
        <version>1.0-alpha-5</version>
        <inherited>false</inherited>
        <configuration>
            <fork>true</fork>
            <outputDirectory>${project.build.directory}/classes</outputDirectory>
            <options>
                <option>web.content.root=${project.build.directory}/classes</option>
            </options>
        </configuration>
        <executions>
            <execution>
                <goals>
                    <goal>process</goal>
                </goals>
            </execution>
        </executions>
        <dependencies>
            <dependency>
                <groupId>org.apache.beehive</groupId>
                <artifactId>beehive-netui-compiler</artifactId>
                <version>1.0.2</version>
            </dependency>
        </dependencies>
    </plugin>

生成日志:

[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.comcast.ets.tpp.portout:PortOutWeb:war:20.08
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: javax.xml.rpc:javax.xml.rpc-api:jar -> duplicate declaration of version 1.1.1 @ line 296, column 15
[WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: oro:oro:jar -> duplicate declaration of version 2.0.8 @ com.comcast.ets.tpp.portout:PortOut:20.08, /Users/bchart545/Documents/workspace/PortOutGui/pom.xml, line 273, column 16
[WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.comcast.provisioning:weblogic-controls:jar -> duplicate declaration of version 9.2 @ com.comcast.ets.tpp.portout:PortOut:20.08, /Users/bchart545/Documents/workspace/PortOutGui/pom.xml, line 335, column 16
[WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: javax.xml.rpc:javax.xml.rpc-api:jar -> duplicate declaration of version 1.1.1 @ com.comcast.ets.tpp.portout:PortOut:20.08, /Users/bchart545/Documents/workspace/PortOutGui/pom.xml, line 397, column 16
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.comcast.ets.tpp.portout:PortOut:pom:20.08
[WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: oro:oro:jar -> duplicate declaration of version 2.0.8 @ line 273, column 16
[WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.comcast.provisioning:weblogic-controls:jar -> duplicate declaration of version 9.2 @ line 335, column 16
[WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: javax.xml.rpc:javax.xml.rpc-api:jar -> duplicate declaration of version 1.1.1 @ line 397, column 16
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] PortOut
[INFO] PortOutWeb
[INFO] PortOutApp
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building PortOut 20.08
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ PortOut ---
[INFO] 
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ PortOut ---
[INFO] Installing /Users/bchart545/Documents/workspace/PortOutGui/pom.xml to /Users/bchart545/.m2/repository/com/comcast/ets/tpp/portout/PortOut/20.08/PortOut-20.08.pom
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building PortOutWeb 20.08
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com:apache-jakarta-oro:jar:2.0.8 is missing, no dependency information available
[WARNING] The POM for com.comcast.provisioning:oms-service-client:jar:12.10 is missing, no dependency information available
[WARNING] The POM for com.comcast.provisioning:npac-service-client:jar:1.0 is missing, no dependency information available
[WARNING] The POM for com.comcast.provisioning:weblogic:jar:10.3.3 is missing, no dependency information available
[WARNING] The POM for com.comcast.provisioning:weblogic-controls:jar:9.2 is missing, no dependency information available
[WARNING] The POM for com.comcast.provisioning:weblogic-netui:jar:9.2 is missing, no dependency information available
[WARNING] The POM for com.comcast.provisioning:wlw-system:jar:9.2 is missing, no dependency information available
[WARNING] The POM for com.comcast.provisioning:wlcommons-logging:jar:9.2 is missing, no dependency information available
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ PortOutWeb ---
[INFO] Deleting /Users/bchart545/Documents/workspace/PortOutGui/PortOutWeb/target
[INFO] 
[INFO] --- apt-maven-plugin:1.0-alpha-5:process (default) @ PortOutWeb ---
[INFO] Processing 258 source files
 [WARNING] warning: Annotation types without processors: [javax.xml.bind.annotation.XmlAccessorType, javax.xml.bind.annotation.XmlType, javax.xml.bind.annotation.XmlRootElement, javax.xml.bind.annotation.XmlElement, javax.xml.bind.annotation.XmlSchemaType, java.lang.Override, javax.xml.bind.annotation.XmlEnum, javax.xml.bind.annotation.XmlEnumValue, java.lang.SuppressWarnings, org.apache.beehive.controls.system.jdbc.JdbcControl.ConnectionDataSource, org.apache.beehive.controls.system.jdbc.JdbcControl.SQL, javax.xml.bind.annotation.XmlRegistry, com.bea.control.annotations.TransactionAttribute, org.springframework.transaction.annotation.Transactional, javax.xml.bind.annotation.XmlSchema]
[WARNING] /Users/bchart545/Documents/workspace/PortOutGui/PortOutWeb/src/main/java/Controller.java:124: warning: File "index.jsp" could not be found in the web application.
[WARNING] Problem encountered during annotation processing; 
[WARNING] see stacktrace below for more information.
[WARNING] java.lang.NullPointerException
[WARNING]   at org.apache.beehive.controls.runtime.generator.apt.ControlClientAnnotationProcessor.generate(ControlClientAnnotationProcessor.java:153)
[WARNING]   at org.apache.beehive.controls.runtime.generator.apt.TwoPhaseAnnotationProcessor.process(TwoPhaseAnnotationProcessor.java:90)
[WARNING]   at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
[WARNING]   at com.sun.tools.apt.comp.Apt.main(Unknown Source)
[WARNING]   at com.sun.tools.apt.main.JavaCompiler.compile(Unknown Source)
[WARNING]   at com.sun.tools.apt.main.Main.compile(Unknown Source)
[WARNING]   at com.sun.tools.apt.main.Main.compile(Unknown Source)
[WARNING]   at com.sun.tools.apt.Main.processing(Unknown Source)
[WARNING]   at com.sun.tools.apt.Main.process(Unknown Source)
[WARNING]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[WARNING]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[WARNING]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[WARNING]   at java.lang.reflect.Method.invoke(Method.java:597)
[WARNING]   at org.codehaus.mojo.apt.AptUtils.invoke(AptUtils.java:114)
[WARNING]   at org.codehaus.mojo.apt.AbstractAptMojo.executeApt(AbstractAptMojo.java:389)
[WARNING]   at org.codehaus.mojo.apt.AbstractAptMojo.executeImpl(AbstractAptMojo.java:277)
[WARNING]   at org.codehaus.mojo.apt.AbstractAptMojo.execute(AbstractAptMojo.java:254)
[WARNING]   at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
[WARNING]   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
[WARNING]   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[WARNING]   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[WARNING]   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
[WARNING]   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
[WARNING]   at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
[WARNING]   at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
[WARNING]   at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
[WARNING]   at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
[WARNING]   at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
[WARNING]   at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
[WARNING]   at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
[WARNING]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[WARNING]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[WARNING]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[WARNING]   at java.lang.reflect.Method.invoke(Method.java:597)
[WARNING]   at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
[WARNING]   at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
[WARNING]   at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
[WARNING]   at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] PortOut ........................................... SUCCESS [0.211s]
[INFO] PortOutWeb ........................................ FAILURE [1:02.145s]
[INFO] PortOutApp ........................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:02.464s
[INFO] Finished at: Wed Aug 26 16:51:36 GMT-07:00 2020
[INFO] Final Memory: 22M/82M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:apt-maven-plugin:1.0-alpha-5:process (default) on project PortOutWeb: Apt failed -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:apt-maven-plugin:1.0-alpha-5:process (default) on project PortOutWeb: Apt failed
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Apt failed
    at org.codehaus.mojo.apt.AbstractAptMojo.executeApt(AbstractAptMojo.java:394)
    at org.codehaus.mojo.apt.AbstractAptMojo.executeImpl(AbstractAptMojo.java:277)
    at org.codehaus.mojo.apt.AbstractAptMojo.execute(AbstractAptMojo.java:254)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)

共有1个答案

林和煦
2023-03-14

添加以下依赖项解决了该问题:

            <dependency>
                <groupId>org.apache.axis</groupId>
                <artifactId>axis</artifactId>
                <version>1.4</version>
            </dependency>
 类似资料: