Преглед изворни кода

Provision libraries in 'lib' automatically

Upon special request by Andy Clement, I included 'lib' as a child module
in the parent POM again, making several modules which refer to
downloaded library files dependent the 'lib' module. I am not sure I
caught all of them, but I hope so.

Now after cloning the project and configuring the token for reading from
GitHub Packages (sorry!), you can just run a Maven build for the main
project and no longer need to fail the first build, read the Maven
Enforcer message and run 'cd lib && mvn compile' as a first step. This
convenience comes at the price of a more complex POM and two new
profiles:

  - Profile 'provision-libs' is auto-activated by the absence of a
    marker file, kicking off the library provisioning process and
    creating same marker file at the end, if successful. Therefore,
    during subsequent builds libraries will not be re-provisioned,
    because the marker file exists and Maven skips all download and
    (un)zip steps, which saves build time and bandwidth. Otherwise
    offline builds would not work either.

  - Profile 'clean-libs' needs to be activated manually, because by
    default 'mvn clean' will not erase provisioned libraries. In most
    cases, even after a clean a developer does not want to re-provision
    all libraries if they have not changed (e.g. new JDT Core build).
    But if you do wish too erase the libraries and the marker file, just
    call 'cd lib && mvn -P clean-libs clean'.

Please note: The Maven Enforcer build step, which additionally checks
for existence of other files, still exists and was moved from the parent
POM to 'libs'. No matter if provisioning was just done or skipped
because the main marker file exists, a quick heuristic check for that
list of files is done during each build, failing the build with a
comprehensive message if an inconsistency was found. The error message
says which files are missing and tells the user:

  "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."

This should cover the topic.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
tags/V1_9_7_M2
Alexander Kriegisch пре 2 година
родитељ
комит
99476f7d82
16 измењених фајлова са 773 додато и 631 уклоњено
  1. 2
    1
      .gitignore
  2. 5
    0
      ajde.core/pom.xml
  3. 6
    0
      ajdoc/pom.xml
  4. 8
    0
      bcel-builder/pom.xml
  5. 5
    0
      build/pom.xml
  6. 9
    0
      docs/pom.xml
  7. 680
    587
      lib/pom.xml
  8. 6
    0
      org.aspectj.ajdt.core/pom.xml
  9. 8
    43
      pom.xml
  10. 6
    0
      run-all-junit-tests/pom.xml
  11. 6
    0
      taskdefs/pom.xml
  12. 5
    0
      testing-util/pom.xml
  13. 6
    0
      testing/pom.xml
  14. 6
    0
      tests/pom.xml
  15. 9
    0
      util/pom.xml
  16. 6
    0
      weaver/pom.xml

+ 2
- 1
.gitignore Прегледај датотеку

@@ -31,7 +31,8 @@ log.txt
# No idea where these come from
bin/

# Downloaded libraries used during tests
# Downloaded libraries used during tests + marker file
/lib/provisioned.marker
/lib/ant/
/lib/commons/
/lib/docbook/

+ 5
- 0
ajde.core/pom.xml Прегледај датотеку

@@ -12,6 +12,11 @@
<artifactId>ajde.core</artifactId>

<dependencies>
<dependency>
<!-- All modules referencing files inside 'lib' need this dependency -->
<groupId>org.aspectj</groupId>
<artifactId>lib</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>util</artifactId>

+ 6
- 0
ajdoc/pom.xml Прегледај датотеку

@@ -28,6 +28,12 @@

<dependencies>

<dependency>
<!-- All modules referencing files inside 'lib' need this dependency -->
<groupId>org.aspectj</groupId>
<artifactId>lib</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>util</artifactId>

+ 8
- 0
bcel-builder/pom.xml Прегледај датотеку

@@ -11,4 +11,12 @@

<artifactId>bcel-builder</artifactId>

<dependencies>
<dependency>
<!-- All modules referencing files inside 'lib' need this dependency -->
<groupId>org.aspectj</groupId>
<artifactId>lib</artifactId>
</dependency>
</dependencies>

</project>

+ 5
- 0
build/pom.xml Прегледај датотеку

@@ -12,6 +12,11 @@
<artifactId>build</artifactId>

<dependencies>
<dependency>
<!-- All modules referencing files inside 'lib' need this dependency -->
<groupId>org.aspectj</groupId>
<artifactId>lib</artifactId>
</dependency>
<dependency>
<!-- Identical to lib/ant/lib/ant.jar, a former system-scoped dependency -->
<groupId>ant</groupId>

+ 9
- 0
docs/pom.xml Прегледај датотеку

@@ -87,6 +87,15 @@
</plugins>

</build>

<dependencies>
<dependency>
<!-- All modules referencing files inside 'lib' need this dependency -->
<groupId>org.aspectj</groupId>
<artifactId>lib</artifactId>
</dependency>
</dependencies>

</profile>
</profiles>


+ 680
- 587
lib/pom.xml
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 6
- 0
org.aspectj.ajdt.core/pom.xml Прегледај датотеку

@@ -12,6 +12,12 @@
<artifactId>org.aspectj.ajdt.core</artifactId>

<dependencies>
<dependency>
<!-- All modules referencing files inside 'lib' need this dependency -->
<groupId>org.aspectj</groupId>
<artifactId>lib</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>bridge</artifactId>

+ 8
- 43
pom.xml Прегледај датотеку

@@ -27,7 +27,6 @@
<lib.commons.logging.version>1.0.1</lib.commons.logging.version>
<lib.commons.logging.tag>LOGGING_1_0_1</lib.commons.logging.tag>
<asm.version>9.1</asm.version>
<lib.directory>${maven.multiModuleProjectDirectory}/lib</lib.directory>
</properties>

<repositories>
@@ -47,6 +46,7 @@
</repositories>

<modules>
<module>lib</module>
<module>util</module>
<module>bridge</module>
<module>testing-util</module>
@@ -73,7 +73,6 @@
<!-- FYI: These are NOT meant to be sub-modules but a stand-alone projects built and deployed independently. -->
<!--
<module>asm-renamed</module>
<module>lib</module>
-->

<!-- create the important artifacts we care about -->
@@ -279,51 +278,11 @@
<ignoredUnusedDeclaredDependencies>
<!-- Declared in parent POM for convenience, but not used in every module -->
<ignoredUnusedDeclaredDependency>junit:junit:jar</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.aspectj:lib:jar</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-libraries-exist</id>
<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>
Please go to module subdirectory 'lib' and run 'mvn compile' there. This should take care of downloading all necessary libraries to that directory, where some tests expect them to be.
</message>
<files>
<file>${lib.directory}/ant/bin/ant.bat</file>
<file>${lib.directory}/ant/lib/junit.jar</file>
<file>${lib.directory}/commons/commons.jar</file>
<file>${lib.directory}/docbook/docbook-dtd/docbookx.dtd</file>
<file>${lib.directory}/docbook/docbook-xsl/html/chunk.xsl</file>
<file>${lib.directory}/docbook/fop.jar</file>
<file>${lib.directory}/docbook/batik.jar</file>
<file>${lib.directory}/jarjar/jarjar-1.3.jar</file>
<file>${lib.directory}/jdtcore-aj/jdtcore-for-aspectj.jar</file>
<file>${lib.directory}/junit/junit.jar</file>
<file>${lib.directory}/regexp/jakarta-regexp-1.2.jar</file>
<file>${lib.directory}/saxon/saxon.jar</file>
</files>
</requireFilesExist>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>

</plugins>

</build>
@@ -364,6 +323,12 @@
<artifactId>asm-renamed</artifactId>
<version>${asm.version}</version>
</dependency>
<dependency>
<!-- All modules referencing files inside 'lib' need this dependency -->
<groupId>org.aspectj</groupId>
<artifactId>lib</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>


+ 6
- 0
run-all-junit-tests/pom.xml Прегледај датотеку

@@ -13,6 +13,12 @@

<dependencies>

<dependency>
<!-- All modules referencing files inside 'lib' need this dependency -->
<groupId>org.aspectj</groupId>
<artifactId>lib</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>util</artifactId>

+ 6
- 0
taskdefs/pom.xml Прегледај датотеку

@@ -12,6 +12,12 @@
<artifactId>taskdefs</artifactId>

<dependencies>
<dependency>
<!-- All modules referencing files inside 'lib' need this dependency -->
<groupId>org.aspectj</groupId>
<artifactId>lib</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>util</artifactId>

+ 5
- 0
testing-util/pom.xml Прегледај датотеку

@@ -12,6 +12,11 @@
<artifactId>testing-util</artifactId>

<dependencies>
<dependency>
<!-- All modules referencing files inside 'lib' need this dependency -->
<groupId>org.aspectj</groupId>
<artifactId>lib</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>util</artifactId>

+ 6
- 0
testing/pom.xml Прегледај датотеку

@@ -12,6 +12,12 @@
<artifactId>testing</artifactId>

<dependencies>
<dependency>
<!-- All modules referencing files inside 'lib' need this dependency -->
<groupId>org.aspectj</groupId>
<artifactId>lib</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>util</artifactId>

+ 6
- 0
tests/pom.xml Прегледај датотеку

@@ -13,6 +13,12 @@

<dependencies>

<dependency>
<!-- All modules referencing files inside 'lib' need this dependency -->
<groupId>org.aspectj</groupId>
<artifactId>lib</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>util</artifactId>

+ 9
- 0
util/pom.xml Прегледај датотеку

@@ -11,4 +11,13 @@

<artifactId>util</artifactId>

<dependencies>
<dependency>
<!-- All modules referencing files inside 'lib' need this dependency -->
<groupId>org.aspectj</groupId>
<artifactId>lib</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>

+ 6
- 0
weaver/pom.xml Прегледај датотеку

@@ -12,6 +12,12 @@
<artifactId>weaver</artifactId>

<dependencies>
<dependency>
<!-- All modules referencing files inside 'lib' need this dependency -->
<groupId>org.aspectj</groupId>
<artifactId>lib</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>util</artifactId>

Loading…
Откажи
Сачувај