aspectj-maven-plugin
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency> <groupId>dev.aspectj</groupId> <artifactId>aspectj-maven-plugin</artifactId> <version>1.13.1</version> </dependency>
<?xml version="1.0" encoding="UTF-8"?> <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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.codehaus.mojo</groupId> <artifactId>mojo-parent</artifactId> <version>63</version> </parent> <groupId>dev.aspectj</groupId> <artifactId>aspectj-maven-plugin</artifactId> <version>1.13.1</version> <packaging>maven-plugin</packaging> <name>AspectJ Maven Plugin</name> <description> Handles AspectJ usage within Maven. Functionality provided is: weaving of aspects (or existing aspects from libraries) with the test and/or main classes, weaving of pre-existing jars and ajdoc reporting. </description> <inceptionYear>2018</inceptionYear> <properties> <aspectjVersion>1.9.8.RC1</aspectjVersion> <!-- Minimum Maven version required to build this plugin --> <mavenBuildVersion>3.1.1</mavenBuildVersion> <!-- Maven API version used by this plugin (seems to be backward compatible to Maven 3.1.x, maybe even 3.0.x) --> <mavenAPIVersion>3.8.3</mavenAPIVersion> <!-- Minimum Maven version required to run this plugin (not enforced at the moment, see 'prerequisites' section) --> <mavenRuntimeVersion>3.0.5</mavenRuntimeVersion> <junitVersion>4.13.2</junitVersion> <doxiaVersion>1.10</doxiaVersion> <doxiaSitetoolsVersion>1.10</doxiaSitetoolsVersion> <mojo.java.target>1.8</mojo.java.target> <!-- aspectJ > 1.8.13 is JDK 1.8 minimum --> <!-- work around until it is correctly fixed at top parent --> <scmpublish.content>${project.build.directory}/staging/aspectj-maven-plugin</scmpublish.content> </properties> <prerequisites> <!-- Minimum Maven version required to both build and use plugin. See Maven Enforcer configuration where the build version is further restricted. Actually, despite using API version 3.8.1, a quick test shows that this plugin still works fine on Maven 3.0.5, as long as the plugins from the Maven root POM for that old version are - locally available or - can be downloaded via HTTP instead of HTTPS (e.g. via Nexus, Maven Central deactivated HTTP) or - have been updated in the user's POM to versions locally available or downloadable via HTTP (not HTTPS). Maybe it would work on still older Maven versions, but I (Alexander Kriegisch) did not test. --> <maven>${mavenRuntimeVersion}</maven> </prerequisites> <issueManagement> <system>GitHub</system> <url>https://github.com/dev-aspectj/aspectj-maven-plugin/issues/</url> </issueManagement> <scm> <connection>scm:git:https://github.com/dev-aspectj/aspectj-maven-plugin.git</connection> <developerConnection>scm:git:ssh://git@github.com/dev-aspectj/aspectj-maven-plugin.git</developerConnection> <url>https://github.com/dev-aspectj/aspectj-maven-plugin</url> </scm> <distributionManagement> <snapshotRepository> <id>ossrh</id> <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url> </snapshotRepository> <repository> <id>ossrh</id> <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url> </repository> </distributionManagement> <developers> <developer> <id>kaare</id> <name>Kaare Nilsen</name> <email>kaare.nilsen@gmail.com</email> <organization>Arktekk</organization> <organizationUrl>http://arktekk.no</organizationUrl> <roles> <role>Java Developer</role> </roles> <timezone>+1</timezone> </developer> <developer> <name>Lennart Jörelid</name> <email>lj@jguru.se</email> <organization>jGuru Europe AB</organization> <roles> <role>Java Developer</role> </roles> <timezone>+1</timezone> </developer> <developer> <id>kriegaex</id> <name>Alexander Kriegisch</name> <email>kriegaex@aspectj.dev</email> </developer> </developers> <contributors> <contributor> <name>Thor Age Eldby</name> <email>tel@objectnet.no</email> <roles> <role>Java Developer</role> </roles> <timezone>+1</timezone> </contributor> <contributor> <name>David J. M. Karlsen</name> <email>david@davidkarlsen.com</email> <organization>davidkarlsen.com</organization> <organizationUrl>http://www.davidkarlsen.com</organizationUrl> <roles> <role>Java Developer</role> </roles> <timezone>+1</timezone> </contributor> <contributor> <name>Marvin Froeder</name> <email>velo.br@gmail.com</email> <timezone>-3</timezone> </contributor> <contributor> <name>Krzysztof Debski</name> <email>kdebski85@gmail.com</email> <timezone>+1</timezone> </contributor> <contributor> <name>Nicholas Wong</name> <email>nickwongdev@gmail.com</email> <timezone>America/LosAngeles</timezone> </contributor> </contributors> <dependencyManagement> <dependencies> <!-- CVEs report https://sbom.lift.sonatype.com/report/T1-0ff0976f7f21c391f20f-dfa463bcb34dd-1622009500-fb5c1335856646e2ad417879bb4cf6bc --> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.13</version> </dependency> <!-- CVEs report https://sbom.lift.sonatype.com/report/T1-0ff0976f7f21c391f20f-dfa463bcb34dd-1622009500-fb5c1335856646e2ad417879bb4cf6bc --> <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> <version>1.9.4</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${junitVersion}</version> <scope>test</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <!-- Maven core --> <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-utils</artifactId> <version>3.4.1</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-core</artifactId> <version>${mavenAPIVersion}</version> <scope>provided</scope> </dependency> <!-- org.apache.maven:maven-core:jar:3.8.2 defines test scope for plexus-cipher. Weirdly enough, this breaks test execution because a plexus-cipher class cannot be found. Defining a compile dependency fixes the problem. TODO: remove after https://issues.apache.org/jira/browse/MNG-7219 is fixed. --> <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-cipher</artifactId> <version>2.0</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-model</artifactId> <version>${mavenAPIVersion}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.maven.reporting</groupId> <artifactId>maven-reporting-api</artifactId> <version>3.0</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-plugin-api</artifactId> <version>${mavenAPIVersion}</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-artifact</artifactId> <version>${mavenAPIVersion}</version> </dependency> <dependency> <groupId>org.apache.maven.plugin-tools</groupId> <artifactId>maven-plugin-annotations</artifactId> <scope>provided</scope><!-- annotations are needed only to build the plugin --> </dependency> <!-- Other --> <!-- see: https://cwiki.apache.org/confluence/display/MAVEN/Plugin+migration+to+Maven3+dependencies --> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-compat</artifactId> <version>${mavenAPIVersion}</version> <scope>test</scope> </dependency> <!-- Needed by goal 'aspectj-report' --> <dependency> <groupId>org.apache.maven.doxia</groupId> <artifactId>doxia-sink-api</artifactId> <version>${doxiaVersion}</version> </dependency> <dependency> <groupId>org.apache.maven.doxia</groupId> <artifactId>doxia-site-renderer</artifactId> <version>${doxiaSitetoolsVersion}</version> </dependency> <dependency> <groupId>org.apache.maven.reporting</groupId> <artifactId>maven-reporting-impl</artifactId> <version>3.0.0</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjtools</artifactId> <version>${aspectjVersion}</version> </dependency> <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>3.2.2</version> </dependency> <!-- This is required to make the ajdoc tool work properly. When generating the AspectJ site documentation, the following debug statement is emitted onto the log: [DEBUG] Running : ajdoc -classpath [... a long classpath follows ...] ajdoc requires a JDK 1.4 or later tools jar - exiting --> <!-- Test --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.maven.plugin-testing</groupId> <artifactId>maven-plugin-testing-harness</artifactId> <version>3.3.0</version> <scope>test</scope> </dependency> </dependencies> <build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>3.1.2</version> <dependencies> <!-- TODO: remove dependency as soon as Checkstyle Plugin depending on v4 is available --> <dependency> <groupId>org.apache.maven.shared</groupId> <artifactId>maven-shared-resources</artifactId> <!-- TODO: Switch to version 4, as soon as it is available on Maven Central --> <version>5-SNAPSHOT</version> </dependency> <dependency> <groupId>com.puppycrawl.tools</groupId> <artifactId>checkstyle</artifactId> <version>9.0.1</version> </dependency> </dependencies> </plugin> </plugins> </pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugin-plugin</artifactId> <version>3.6.1</version> <configuration> <!-- see: https://github.com/apache/maven-plugin-tools/pull/11 --> <mojoDependencies> <!-- Use sub elements instead of comma separated string for Maven < 3.3.9 compatibility --> <mojoDependency>dev.aspectj:aspectj-maven-plugin</mojoDependency> </mojoDependencies> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <version>3.0.0</version> <executions> <execution> <id>enforce-bytecode-version</id> <goals> <goal>enforce</goal> </goals> <configuration> <rules> <enforceBytecodeVersion> <maxJdkVersion>${mojo.java.target}</maxJdkVersion> <excludes> <exclude>com.sun:tools</exclude> <!-- AspectJ 1.9.8.M1 was the last one to use older Eclipse Core dependencies limited to Java 8 byte code. As of 1.9.8.RC1 with full Java 17 support, ECJ and JDT Core depend on libraries containing Java 11 class files, though. This is the new Eclipse standard. --> <exclude>org.aspectj:aspectjtools</exclude> </excludes> </enforceBytecodeVersion> <requireMavenVersion> <version>${mavenBuildVersion}</version> </requireMavenVersion> </rules> </configuration> </execution> </executions> <dependencies> <dependency> <groupId>org.codehaus.mojo</groupId> <artifactId>extra-enforcer-rules</artifactId> <version>1.4</version> </dependency> </dependencies> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skip>false</skip> <excludes> <exclude>**/test-project/**/*.java</exclude> <exclude>**/parent-child-test-project/**/*.java</exclude> <exclude>**/AbstractAjcMojoTest.java</exclude> </excludes> </configuration> </plugin> <!-- Provides PlantUML integration into site deployments. NOTE: You need a local Graphviz installation (https://graphviz.org/download/), and it must be on the path of the user running the build. Otherwise, UML diagrams like src/site/uml/multimodule_ajc.puml will not be generated correctly. Instead, without any error message, a dummy image target/site/images/plantuml/multimodule_ajc.png containing an error message will be generated and become part of the Maven site. --> <!-- TODO: Because of https://github.com/Huluvu424242/plantuml-maven-plugin/issues/27, the new plugin fork does not work on JDK 8. Alexander Kriegisch fixed this in https://github.com/Huluvu424242/plantuml-maven-plugin/pull/31 and published a forked plugin with group ID 'dev.aspectj'. As soon as this is merged and a new upstream release is available, switch back to group ID 'com.github.funthomas424242'. TODO: Because of https://github.com/Huluvu424242/plantuml-maven-plugin/issues/28, the plugin does not fail the build if Graphviz is not installed or not on the path. The plugin simply generates dummy PNG files, which go unnoticed unless somebody visually checks them. --> <plugin> <groupId>dev.aspectj</groupId> <artifactId>plantuml-maven-plugin</artifactId> <version>1.5.2.J8</version> <configuration> <sourceFiles> <directory>${basedir}</directory> <includes> <include>src/site/**/*.puml</include> </includes> </sourceFiles> <outputDirectory>${project.build.directory}/site/images/plantuml</outputDirectory> </configuration> <executions> <execution> <id>generate-plantuml-diagrams</id> <goals> <goal>generate</goal> </goals> <phase>pre-site</phase> </execution> </executions> <dependencies> <dependency> <groupId>net.sourceforge.plantuml</groupId> <artifactId>plantuml</artifactId> <version>1.2021.12</version> </dependency> </dependencies> </plugin> </plugins> </build> <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugin-plugin</artifactId> <version>3.5</version> <configuration> <!-- see: https://github.com/apache/maven-plugin-tools/pull/11 --> <mojoDependencies>dev.aspectj:aspectj-maven-plugin</mojoDependencies> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>l10n-maven-plugin</artifactId> <version>1.0-alpha-2</version> <configuration> <locales> <locale>nl</locale> <locale>sv</locale> </locales> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <configuration> <!-- Amend mojo-parent default config, avoiding errors concerning modules vs. unnamed module packages --> <source>8</source> </configuration> </plugin> </plugins> </reporting> <profiles> <!-- AspectJ compilation requires that tools.jar (or its equivalent for some JDKs) is found on the classpath. The profiles named [something]toolsJar-profile define the systemPath for the tools.jar dependency by overriding the dummy systemPath from the dependencyManagement section. CAVEAT: Setting the systemPath it via a profile-dependent property like in earlier plugin versions does *not* work when the compiled plugin is used from Eclipse because properties are incorrectly merged by Eclipse, leading to problems ever since the 'java8' profile was introduced here because it also defines a property. --> <profile> <id>tools-jar</id> <activation> <jdk>1.8</jdk> <!-- activate only on JDK8, as 8 is minimum version to run aspectj on--> </activation> <dependencies> <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.8</version> <scope>system</scope> <systemPath>${java.home}/../lib/tools.jar</systemPath> </dependency> </dependencies> </profile> <profile> <id>java8</id> <activation> <jdk>[1.8,)</jdk> </activation> <properties> <!-- Because of this properties section the old way of setting the tools.jar path via a property defined in another profile does not work anymore when importing Maven projects into Eclipse. :-( --> <additionalparam>-Xdoclint:none</additionalparam> </properties> </profile> <profile> <id>maven-repo-local</id> <activation> <property> <name>maven.repo.local</name> </property> </activation> <build> <plugins> <plugin> <artifactId>maven-surefire-plugin</artifactId> <configuration> <systemProperties> <property> <!-- Pass this through to the tests (if set!) to have them pick the right repository --> <name>maven.repo.local</name> <value>${maven.repo.local}</value> </property> </systemProperties> </configuration> </plugin> </plugins> </build> </profile> <profile> <id>integration-test</id> <activation> <!-- CAVEAT: 'activeByDefault=true' does not work reliably and immediately deactivates the profile, as soon as other profiles are activated explicitly or via activation conditions, either in this POM or in the Mojohaus parent. See https://stackoverflow.com/a/5309576/1082681, https://issues.apache.org/jira/browse/MNG-4917. Therefore, we activate it based on a file which always exists. Thanks, Maven! :-/ Note: ${project.basedir} is not supported during profile activation, use ${basedir} instead. --> <file> <exists>${basedir}/pom.xml</exists> </file> </activation> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-invoker-plugin</artifactId> <version>3.2.2</version> <executions> <execution> <id>integration-test</id> <goals> <goal>install</goal> <goal>run</goal> </goals> </execution> </executions> <configuration> <projectsDirectory>src/it</projectsDirectory> <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo> <postBuildHookScript>verify</postBuildHookScript> <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath> <goals> <goal>clean</goal> <goal>test</goal> </goals> <settingsFile>src/it/settings.xml</settingsFile> <!-- Do not deactivate! At least 14 integration tests assert on debug output. --> <debug>true</debug> </configuration> </plugin> </plugins> </build> </profile> <!-- GPG Signature on release --> <profile> <id>release-sign-artifacts</id> <activation> <property> <name>performRelease</name> <value>true</value> </property> </activation> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-gpg-plugin</artifactId> <version>3.0.1</version> <executions> <execution> <id>sign-artifacts</id> <phase>verify</phase> <goals> <goal>sign</goal> </goals> </execution> </executions> </plugin> <plugin> <!-- Other than Maven Deploy, this plugin cannot just be added to the 'build/plugins' section of the parent POM once and (de-)activated with a simple property like 'maven.deploy.skip' on a per-module basis. See also https://issues.sonatype.org/browse/OSSRH-68966. Consequently, we do not add it to the parent but separately to each module meant to be published. --> <groupId>org.sonatype.plugins</groupId> <artifactId>nexus-staging-maven-plugin</artifactId> <version>1.6.8</version> <extensions>true</extensions> <configuration> <serverId>ossrh</serverId> <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl> <!-- Activate in order to directly release to Maven Central after successful staging --> <autoReleaseAfterClose>false</autoReleaseAfterClose> </configuration> <dependencies> <!-- Plugin version 1.6.8 does not work on JDK 16+ without special MAVEN_OPTS opening certain modules, because the XStream version used needs it. One workaround is to use a more recent XStream version. Attention: Do *not* upgrade to e.g. 1.4.18, because it causes exceptions during deployment. TODO: remove plugin dependency after OSSRH-66257, NEXUS-26993 are fixed. --> <dependency> <groupId>com.thoughtworks.xstream</groupId> <artifactId>xstream</artifactId> <version>1.4.15</version> </dependency> </dependencies> </plugin> </plugins> </build> </profile> </profiles> </project>