Attempting to get aspect annotation recognized by eclipse luna while using m2e (maven) build

764 Views Asked by At

I'd like to start using Aspects within my Java code and found a RetryOnFailure annotation that I decided would be my first one. At first my POM file showed an error, but through some research it seems that m2e in eclipse doesn't know when to run/build so I had to add a lifecycleMappingMetadata to my POM that got me past that. However I still get an error in the class file on the Annotation within Eclipse. Any idea how to get past that would be greatly appreciated.

Relevant piece of class file:

    @RetryOnFailure(attempts = 2, delay = 10, verbose = false)
private static LeadQualificationResponse callLeadQualificaiton(LeadQualificationRequest leadQualificationRequest, MidasStub midasStub) throws RemoteException {
    LeadQualificationResponse leadQualificationResponse = null;
    leadQualificationResponse = midasStub.leadQualification(leadQualificationRequest);
    return leadQualificationResponse;
}

Snippets of POM:

        <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>com.jcabi</groupId>
                                    <artifactId>jcabi-maven-plugin</artifactId>
                                    <versionRange>[0.8,)</versionRange>
                                    <goals>
                                        <goal>ajc</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute>
                                        <runOnIncremental>false</runOnIncremental>
                                    </execute>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
<plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.jcabi</groupId>
            <artifactId>jcabi-maven-plugin</artifactId>
            <version>0.8</version>
            <executions>
                <execution>
                    <goals>
                        <goal>ajc</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>

I've also tried to set the runOnIncremental to true and get the following error in the POM file on the execution element

Execution default of goal com.jcabi:jcabi-maven-plugin:0.8:ajc failed: A required class was missing while executing com.jcabi:jcabi-maven-plugin:0.8:ajc: Lorg/sonatype/aether/RepositorySystemSession;

realm = plugin>com.jcabi:jcabi-maven-plugin:0.8 strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy urls[0] = file:/C:/Users/Jeffrey/.m2/repository/com/jcabi/jcabi-maven-plugin/0.8/jcabi-maven-plugin-0.8.jar urls[1] = file:/C:/Users/Jeffrey/.m2/repository/com/jcabi/jcabi-log/0.7.22/jcabi-log-0.7.22.jar urls[2] = file:/C:/Users/Jeffrey/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar urls[3] = file:/C:/Users/Jeffrey/.m2/repository/org/aspectj/aspectjrt/1.7.3/aspectjrt-1.7.3.jar urls[4] = file:/C:/Users/Jeffrey/.m2/repository/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.jar urls[5] = file:/C:/Users/Jeffrey/.m2/repository/com/jcabi/jcabi-aether/0.7.22/jcabi-aether-0.7.22.jar urls[6] = file:/C:/Users/Jeffrey/.m2/repository/org/kuali/maven/wagons/maven-s3-wagon/1.1.20/maven-s3-wagon-1.1.20.jar urls[7] = file:/C:/Users/Jeffrey/.m2/repository/org/kuali/common/kuali-s3/1.0.1/kuali-s3-1.0.1.jar urls[8] = file:/C:/Users/Jeffrey/.m2/repository/com/amazonaws/aws-java-sdk/1.4.2/aws-java-sdk-1.4.2.jar urls[9] = file:/C:/Users/Jeffrey/.m2/repository/org/apache/httpcomponents/httpclient/4.1/httpclient-4.1.jar urls[10] = file:/C:/Users/Jeffrey/.m2/repository/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.jar urls[11] = file:/C:/Users/Jeffrey/.m2/repository/commons-codec/commons-codec/1.8/commons-codec-1.8.jar urls[12] = file:/C:/Users/Jeffrey/.m2/repository/org/codehaus/jackson/jackson-core-asl/1.8.9/jackson-core-asl-1.8.9.jar urls[13] = file:/C:/Users/Jeffrey/.m2/repository/org/codehaus/jackson/jackson-mapper-asl/1.8.9/jackson-mapper-asl-1.8.9.jar urls[14] = file:/C:/Users/Jeffrey/.m2/repository/org/springframework/spring-core/3.1.2.RELEASE/spring-core-3.1.2.RELEASE.jar urls[15] = file:/C:/Users/Jeffrey/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar urls[16] = file:/C:/Users/Jeffrey/.m2/repository/org/kuali/common/kuali-threads/1.0.9/kuali-threads-1.0.9.jar urls[17] = file:/C:/Users/Jeffrey/.m2/repository/org/slf4j/jcl-over-slf4j/1.6.4/jcl-over-slf4j-1.6.4.jar urls[18] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/aether/aether-util/1.13.1/aether-util-1.13.1.jar urls[19] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/aether/aether-connector-file/1.13.1/aether-connector-file-1.13.1.jar urls[20] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/aether/aether-connector-asynchttpclient/1.13.1/aether-connector-asynchttpclient-1.13.1.jar urls[21] = file:/C:/Users/Jeffrey/.m2/repository/com/ning/async-http-client/1.6.5/async-http-client-1.6.5.jar urls[22] = file:/C:/Users/Jeffrey/.m2/repository/org/jboss/netty/netty/3.2.5.Final/netty-3.2.5.Final.jar urls[23] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/aether/aether-connector-wagon/1.13.1/aether-connector-wagon-1.13.1.jar urls[24] = file:/C:/Users/Jeffrey/.m2/repository/com/jcabi/jcabi-aspects/0.7.22/jcabi-aspects-0.7.22.jar urls[25] = file:/C:/Users/Jeffrey/.m2/repository/com/jcabi/jcabi-maven-slf4j/0.7.22/jcabi-maven-slf4j-0.7.22.jar urls[26] = file:/C:/Users/Jeffrey/.m2/repository/org/aspectj/aspectjtools/1.7.3/aspectjtools-1.7.3.jar urls[27] = file:/C:/Users/Jeffrey/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar urls[28] = file:/C:/Users/Jeffrey/.m2/repository/org/hibernate/hibernate-validator/5.0.1.Final/hibernate-validator-5.0.1.Final.jar urls[29] = file:/C:/Users/Jeffrey/.m2/repository/org/jboss/logging/jboss-logging/3.1.1.GA/jboss-logging-3.1.1.GA.jar urls[30] = file:/C:/Users/Jeffrey/.m2/repository/com/fasterxml/classmate/0.8.0/classmate-0.8.0.jar urls[31] = file:/C:/Users/Jeffrey/.m2/repository/org/jfrog/maven/annomojo/maven-plugin-anno/1.4.1/maven-plugin-anno-1.4.1.jar urls[32] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/sisu-inject-bean/2.3.0/sisu-inject-bean-2.3.0.jar urls[33] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/sisu-guice/3.1.0/sisu-guice-3.1.0-no_aop.jar urls[34] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/inject/guice-bean-containers/2.3.0/guice-bean-containers-2.3.0.jar urls[35] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/inject/guice-bean-inject/2.3.0/guice-bean-inject-2.3.0.jar urls[36] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/inject/guice-plexus-shim/2.3.0/guice-plexus-shim-2.3.0.jar urls[37] = file:/C:/Users/Jeffrey/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar urls[38] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/sisu-guice/3.1.0/sisu-guice-3.1.0.jar urls[39] = file:/C:/Users/Jeffrey/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar urls[40] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/inject/guice-bean-reflect/2.3.0/guice-bean-reflect-2.3.0.jar urls[41] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/inject/guice-bean-locators/2.3.0/guice-bean-locators-2.3.0.jar urls[42] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/inject/guice-bean-binders/2.3.0/guice-bean-binders-2.3.0.jar urls[43] = file:/C:/Users/Jeffrey/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar urls[44] = file:/C:/Users/Jeffrey/.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar urls[45] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/inject/guice-bean-scanners/2.3.0/guice-bean-scanners-2.3.0.jar urls[46] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/inject/guice-bean-converters/2.3.0/guice-bean-converters-2.3.0.jar urls[47] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/inject/guice-plexus-metadata/2.3.0/guice-plexus-metadata-2.3.0.jar urls[48] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/inject/guice-plexus-converters/2.3.0/guice-plexus-converters-2.3.0.jar urls[49] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/inject/guice-plexus-locators/2.3.0/guice-plexus-locators-2.3.0.jar urls[50] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/inject/guice-plexus-binders/2.3.0/guice-plexus-binders-2.3.0.jar urls[51] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/inject/guice-plexus-scanners/2.3.0/guice-plexus-scanners-2.3.0.jar urls[52] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/inject/guice-plexus-lifecycles/2.3.0/guice-plexus-lifecycles-2.3.0.jar urls[53] = file:/C:/Users/Jeffrey/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.6/plexus-utils-2.0.6.jar urls[54] = file:/C:/Users/Jeffrey/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar urls[55] = file:/C:/Users/Jeffrey/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar urls[56] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar urls[57] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar urls[58] = file:/C:/Users/Jeffrey/.m2/repository/org/sonatype/sisu/sisu-guava/0.11.1/sisu-guava-0.11.1.jar urls[59] = file:/C:/Users/Jeffrey/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar urls[60] = file:/C:/Users/Jeffrey/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar urls[61] = file:/C:/Users/Jeffrey/.m2/repository/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar Number of foreign imports: 1 import: Entry[import from realm ClassRealm[maven.api, parent: null]]


(com.jcabi:jcabi-maven-plugin:0.8:ajc:default:process-classes)

1

There are 1 best solutions below

0
On

Had the same problem. Dont use version 0.8 of the jcabi-maven-plugin. Try with 0.9.2 instead. Seems to be resolved there.