123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306 |
- <?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>
-
- <!-- The AspectJ root POM is the parent, but this module is not a submodule -->
- <parent>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectj-parent</artifactId>
- <version>1.9.23-SNAPSHOT</version>
- </parent>
-
- <artifactId>lib</artifactId>
-
- <description>
- 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.
- </description>
-
- <!-- TODO: Add lib (for now, then finally lib) to .gitignore -->
-
- <properties>
- <lib.provisioned.marker>provisioned.marker</lib.provisioned.marker>
- <lib.ant.name>apache-ant</lib.ant.name>
- <lib.ant.artifact>${lib.ant.name}-${lib.ant.version}</lib.ant.artifact>
- </properties>
-
- <profiles>
-
- <!-- Profile for provisioning - i.e. downloading and (un)zipping - libraries needed during the build -->
- <profile>
- <id>provision-libs</id>
-
- <!-- If marker file is missing, activate profile and provision all libraries -->
- <activation>
- <file>
- <missing>${lib.provisioned.marker}</missing>
- </file>
- </activation>
-
- <build>
- <plugins>
-
- <!-- Download libraries + source code which are unavailable in Maven repositories like Maven Central -->
- <plugin>
- <groupId>com.googlecode.maven-download-plugin</groupId>
- <artifactId>download-maven-plugin</artifactId>
- <version>1.6.7</version>
- <configuration>
- <!-- Detect previously failed downloads by verifying checksums of existing files -> retry -->
- <alwaysVerifyChecksum>true</alwaysVerifyChecksum>
- </configuration>
- <executions>
- <execution>
- <id>download-ant-binaries</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>wget</goal>
- </goals>
- <configuration>
- <url>https://archive.apache.org/dist/ant/binaries/${lib.ant.artifact}-bin.zip</url>
- <outputDirectory>ant</outputDirectory>
- <sha1>3fa9f816a0c4c63249efad8e6225f2e83794f0c0</sha1>
- </configuration>
- </execution>
- <execution>
- <id>download-ant-sources</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>wget</goal>
- </goals>
- <configuration>
- <url>https://archive.apache.org/dist/ant/source/${lib.ant.artifact}-src.zip</url>
- <outputDirectory>ant</outputDirectory>
- <sha1>b9f3c8c31bb6c9069ad5b655059a17769af12f20</sha1>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <!-- Download libraries + source code which are available in Maven repositories like Maven Central -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>3.1.2</version>
- <executions>
- <execution>
- <id>copy</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
-
- <artifactItem>
- <!-- Binary is identical to committed version -->
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <type>jar</type>
- <overWrite>false</overWrite>
- <outputDirectory>junit</outputDirectory>
- <destFileName>junit.jar</destFileName>
- </artifactItem>
- <artifactItem>
- <!-- Binary is identical to committed version -->
- <!-- TODO: Is this redundant JUnit JAR in ant/lib really necessary? If so, why? -->
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <type>jar</type>
- <overWrite>false</overWrite>
- <outputDirectory>ant/lib</outputDirectory>
- <destFileName>junit.jar</destFileName>
- </artifactItem>
- <artifactItem>
- <!-- Binary is identical to committed version -->
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <type>jar</type>
- <classifier>sources</classifier>
- <overWrite>false</overWrite>
- <outputDirectory>junit</outputDirectory>
- <destFileName>junit-src.zip</destFileName>
- </artifactItem>
-
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <!-- (Un)zip downloaded libraries the way our build needs them -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>truezip-maven-plugin</artifactId>
- <!--
- The TrueZIP plugin can seamlessly copy out of or into (nested) ZIP files as if they were normal file system
- paths. No additional moves and deletes with Antrun are necessary.
- -->
- <executions>
- <execution>
- <id>unzip-ant-binaries</id>
- <phase>process-resources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <verbose>true</verbose>
- <fileset>
- <directory>ant/${lib.ant.artifact}-bin.zip/${lib.ant.artifact}</directory>
- <outputDirectory>ant</outputDirectory>
- </fileset>
- </configuration>
- </execution>
- <execution>
- <id>zip-ant-sources</id>
- <phase>process-resources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <verbose>true</verbose>
- <fileset>
- <directory>ant/${lib.ant.artifact}-src.zip/${lib.ant.artifact}/src/main</directory>
- <outputDirectory>ant/ant-src.zip</outputDirectory>
- </fileset>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <!--
- After all libraries have been provisioned successfully, create a marker file in order to avoid provisioning
- them again during the next build
- -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>create-marker-file</id>
- <phase>process-resources</phase>
- <goals>
- <goal>bsh-property</goal>
- </goals>
- <configuration>
- <source><![CDATA[
- myFile = new File(project.getBasedir(), "${lib.provisioned.marker}");
- print("Finished provisioning libraries, creating marker file " + myFile.getCanonicalPath());
- myFile.createNewFile();
- ]]></source>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>org.eclipse.jdt.core</artifactId>
- </dependency>
- </dependencies>
-
- </profile>
-
- <!-- Profile for including provisioned libraries when running 'mvn clean'; inactive by default, activate manually -->
- <profile>
- <id>clean-libs</id>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-clean-plugin</artifactId>
- <executions>
- <execution>
- <id>clean-up-libs</id>
- <phase>clean</phase>
- <goals>
- <goal>clean</goal>
- </goals>
- <configuration>
- <filesets>
- <fileset>
- <directory>.</directory>
- <includes>
- <include>${lib.provisioned.marker}</include>
- <include>ant/**</include>
- <include>jdtcore-aj/**</include>
- <include>junit/**</include>
- </includes>
- <followSymlinks>false</followSymlinks>
- </fileset>
- </filesets>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- </profile>
-
- </profiles>
-
- <build>
- <plugins>
- <!--
- Heuristic consistency check for existence of provisioned library files. Do not just rely on
- ${lib.provisioned.marker} file.
- -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <executions>
- <execution>
- <id>enforce-libraries-exist</id>
- <phase>compile</phase>
- <goals>
- <goal>enforce</goal>
- </goals>
- <configuration>
- <rules>
- <requireFilesExist>
- <!--
- Do NOT insert any line breaks + indentation inside the message, keep it on a single line.
- Maven Enforcer does not strip any whitespace or unindent, which looks quite ugly on the console.
- -->
- <message>
- There is an inconsistency in module subdirectory 'lib'. Please run 'mvn --projects lib -P clean-libs clean compile'. This should take care of cleaning and freshly downloading all necessary libraries to that directory, where some tests expect them to be.
- </message>
- <files>
- <file>${lib.provisioned.marker}</file>
- <file>ant/bin/ant.bat</file>
- <file>ant/lib/junit.jar</file>
- <file>junit/junit.jar</file>
- </files>
- </requireFilesExist>
- </rules>
- <fail>true</fail>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- </project>
|