From d98f01fb7e8f275395214f78d64e03733e6b3970 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Fri, 9 Apr 2021 11:59:05 +0700 Subject: [PATCH] Build libs without additional profiles, add Enforcer rule Because 'libx' no longer is a submodule of the AspectJ parent POM, it will not be built automatically each time an AspectJ build runs. Therefore, is is no longer necessary to shield the zip/unzip steps from repetitive execution by profiles with auto-activation based on the (non-)existence of files. An AspectJ developer knows when to build the module, she does it manually anyway. A new Enforcer rule makes sure to warn the developer if some files it expects to exist in the libs folder are not actually present. Now we also have a Maven Clean rule which wipes away all downloaded and (un-)zipped files. Signed-off-by: Alexander Kriegisch --- libx/pom.xml | 523 ++++++++++++++++++++++++--------------------------- pom.xml | 44 +++++ 2 files changed, 291 insertions(+), 276 deletions(-) diff --git a/libx/pom.xml b/libx/pom.xml index 27d3ce767..1dd0e8239 100644 --- a/libx/pom.xml +++ b/libx/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + org.aspectj aspectj-parent @@ -11,6 +12,26 @@ libx + AspectJ Test Libraries + + This module downloads + installs libraries used by many tests, especially those running as Ant jobs. You should not + build this module during every build because it is somewhat slow, downloading stuff from 3rd-party websites, + unzipping some libraries (e.g. a full Ant distribution) and creating new ZIP files (e.g. source JARs, compound JARs + containing multiple libraries). + + So just run 'mvn compile' once after cloning the AspectJ repository and you should be all set to subsequently build + AspectJ itself. If you forget this step, a Maven Enforcer rule in the AspectJ root POM will fail the build and + remind you to build this module. + + Normally you never have to call 'mvn clean' here, but if for some reason the installed libraries are in an + inconsistent state (e.g. after an incomplete download), you can do so and then run 'mvn compile' again. + + BTW, running 'mvn compile' multiple times will not repeat any download via Maven Dependency or Download Maven + plugins, but repeat all zip/unzip steps in TrueZIP Maven plugin. So try not to call it unnecessarily. + + + + apache-ant ${lib.ant.name}-${lib.ant.version} @@ -19,6 +40,21 @@ + + org.apache.maven.plugins + maven-enforcer-plugin + + + + enforce-libraries-exist + none + + + + com.googlecode.maven-download-plugin download-maven-plugin @@ -68,9 +104,9 @@ wget - https://github.com/apache/commons-collections/archive/refs/tags/collections-2.0.zip + https://github.com/apache/commons-collections/archive/refs/tags/${lib.commons.collections.tag}.zip commons - commons-collections-2.0-sources.jar + commons-collections-${lib.commons.collections.version}-sources.jar 824cacd0aafe21a94fb142388fd62f28a12df5ef @@ -284,281 +320,216 @@ - - - - - - - unzip-ant-binaries - - - - ant/bin/ant.bat - - - - - - org.codehaus.mojo - truezip-maven-plugin - 1.2 - - - unzip-ant-binaries - process-resources - - copy - - - true - - - ant/${lib.ant.artifact}-bin.zip/${lib.ant.artifact} - ant - - - - - - - - - - - zip-ant-sources - - - - ant/ant-src.zip - - - - - - org.codehaus.mojo - truezip-maven-plugin - 1.2 - - - zip-ant-sources - process-resources - - copy - - - true - - - ant/${lib.ant.artifact}-src.zip/${lib.ant.artifact}/src/main - ant/ant-src.zip - - - - - - - - - - - zip-commons-binaries - - - - commons/commons.jar - - - - - - org.codehaus.mojo - truezip-maven-plugin - 1.2 - - - zip-beanutils-binaries - process-resources - - copy - - - true - - - commons/commons-beanutils-${lib.commons.beanutils.version}.jar - commons/commons.jar - - - - - zip-collections-binaries - process-resources - - copy - - - true - - - commons/commons-collections-2.0.jar - commons/commons.jar - - - - - zip-digester-binaries - process-resources - - copy - - - true - - - commons/commons-digester-${lib.commons.digester.version}.jar - commons/commons.jar - - - - - zip-logging-binaries - process-resources - - copy - - - true - - - commons/commons-logging-${lib.commons.logging.version}.jar - commons/commons.jar - - - - - - - - + + org.codehaus.mojo + truezip-maven-plugin + 1.2 + + + unzip-ant-binaries + process-resources + + copy + + + true + + + ant/${lib.ant.artifact}-bin.zip/${lib.ant.artifact} + ant + + + + + zip-ant-sources + process-resources + + copy + + + true + + + ant/${lib.ant.artifact}-src.zip/${lib.ant.artifact}/src/main + ant/ant-src.zip + + + + + zip-beanutils-binaries + process-resources + + copy + + + true + + + commons/commons-beanutils-${lib.commons.beanutils.version}.jar + commons/commons.jar + + + + + zip-collections-binaries + process-resources + + copy + + + true + + + commons/commons-collections-${lib.commons.collections.version}.jar + commons/commons.jar + + + + + zip-digester-binaries + process-resources + + copy + + + true + + + commons/commons-digester-${lib.commons.digester.version}.jar + commons/commons.jar + + + + + zip-logging-binaries + process-resources + + copy + + + true + + + commons/commons-logging-${lib.commons.logging.version}.jar + commons/commons.jar + + + + + zip-beanutils-sources + process-resources + + copy + + + true + + + commons/commons-beanutils-${lib.commons.beanutils.version}-sources.jar/commons-beanutils-${lib.commons.beanutils.tag}/src/java + commons/commons-src.zip + + + + + zip-collections-sources + process-resources + + copy + + + true + + + commons/commons-collections-${lib.commons.collections.version}-sources.jar/commons-collections-${lib.commons.collections.tag}/src/java + commons/commons-src.zip + + + + + zip-digester-sources + process-resources + + copy + + + true + + + commons/commons-digester-${lib.commons.digester.version}-sources.jar/commons-digester-${lib.commons.digester.tag}/src/java + commons/commons-src.zip + + + + + zip-logging-sources + process-resources + + copy + + + true + + + commons/commons-logging-${lib.commons.logging.version}-sources.jar/commons-logging-${lib.commons.logging.tag}/src/java + commons/commons-src.zip + + + + + - - zip-commons-sources - - - - commons/commons-src.zip - - - - - - org.codehaus.mojo - truezip-maven-plugin - 1.2 - - - zip-beanutils-sources - process-resources - - copy - - - true - - - commons/commons-beanutils-${lib.commons.beanutils.version}-sources.jar/commons-beanutils-${lib.commons.beanutils.tag}/src/java - commons/commons-src.zip - - - - - zip-collections-sources - process-resources - - copy - - - true - - - commons/commons-collections-2.0-sources.jar/commons-collections-collections-2.0/src/java - commons/commons-src.zip - - - - - zip-digester-sources - process-resources - - copy - - - true - - - commons/commons-digester-${lib.commons.digester.version}-sources.jar/commons-digester-${lib.commons.digester.tag}/src/java - commons/commons-src.zip - - - - - zip-logging-sources - process-resources - - copy - - - true - - - commons/commons-logging-${lib.commons.logging.version}-sources.jar/commons-logging-${lib.commons.logging.tag}/src/java - commons/commons-src.zip - - - - - - - - + + maven-clean-plugin + + + + . + + ant/** + commons/** + jarjar/** + jdiff/** + junit/** + regexp/** + saxon/** + + false + + + + - - + + diff --git a/pom.xml b/pom.xml index dfba47568..7c6788f1b 100644 --- a/pom.xml +++ b/pom.xml @@ -18,10 +18,14 @@ 1.2 1.4 BEANUTILS_1_4 + 2.0 + collections-2.0 1.3 DIGESTER_1_3 1.0.1 LOGGING_1_0_1 + 9.1 + ${maven.multiModuleProjectDirectory}/libx @@ -48,7 +52,11 @@ build run-all-junit-tests docs + + + aspectjrt @@ -186,6 +194,42 @@ maven-help-plugin + + org.apache.maven.plugins + maven-enforcer-plugin + + + enforce-libraries-exist + + enforce + + + + + + + Please go to module subdirectory 'libx' and run 'mvn compile' there. This should take care of downloading all necessary libraries to that directory, where some tests expect them to be. + + + ${lib.directory}/ant/bin/ant + ${lib.directory}/ant/lib/junit.jar + ${lib.directory}/commons/commons.jar + ${lib.directory}/jarjar/jarjar-1.3.jar + ${lib.directory}/junit/junit.jar + ${lib.directory}/regexp/jakarta-regexp-1.2.jar + ${lib.directory}/saxon/saxon.jar + + + + true + + + + + -- 2.39.5