0

I have Aspects defined in project A which can be referred from project B without any compilations issues because project A has project B as dependency. However project B needs AspectJ plugin so that aspects can be weaved via compilation/build.

Issue : My project B is using com.mysema.querydsl plugin to generate Q files for database entities. When I compile using AspectJ in eclipse (command clean aspectj:compile install) it does NOT auto generate these Q files and thus the compilation fails and weaving is not processed, overall build fails.

I have tried so many combinations of adding this dependency in AspectJ plugin but nothing works.

Please refer the pom part below:

        <!-- AspectJ Maven Plugin -->
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>aspectj-maven-plugin</artifactId>
            <version>1.5</version>
            <dependencies>
                   <dependency>
                      <groupId>com.mysema.querydsl</groupId>
                        <artifactId>querydsl-core</artifactId>
                        <version>3.6.0</version>
                         <scope>compile</scope>
                    </dependency>
            </dependencies>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
                <complianceLevel>1.7</complianceLevel>
            <!--     <aspectLibraries>
                    <aspectLibrary>
                        <groupId>projectA.groupId</groupId>
                        <artifactId>projectA.artifactId</artifactId>
                    </aspectLibrary>
                </aspectLibraries> -->
            </configuration>
            <executions>
                <execution>
                    <!-- <phase>generate-sources</phase> -->
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <!-- AspectJ Maven Plugin -->

What should be done here? I really dont want to create individual aspects in each project. All in all how to build projects with aspectj plugins which have querydsl plugin code references?

kriegaex
  • 63,017
  • 15
  • 111
  • 202
coretechie
  • 1,050
  • 16
  • 38
  • I guess you mean B has a dependency on A, not the other way around, because that woud not make any sense.Correct? I also think that QueryDSL Core should not be a dependency of AspectJ Maven plugin but of module B. But QueryDSL core does not generate code, as far as I understand this after reading about QueryDSL. For code generation you need other Maven plugins. Are they already configured in your module B? Please provide an [SSCCE](http://sscce.org/) with POMs and code, optimally on GitHub. This is way too complex to just answer with you showing a little POM snippet. – kriegaex Feb 09 '17 at 11:57
  • [continued] Please show that you got it working without AspectJ, then we take care of getting aspects working on top of that. – kriegaex Feb 09 '17 at 12:04

0 Answers0