]> source.dussan.org Git - aspectj.git/commitdiff
Use dependencies instead of copies under 'lib' for assemblies
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Fri, 16 Apr 2021 05:14:31 +0000 (12:14 +0700)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Fri, 16 Apr 2021 05:14:31 +0000 (12:14 +0700)
This is one step to get rid of org.aspectj:org.eclipse.jdt.core and
org.aspectj:asm-renamed in the 'lib' directory.

AspectJ tools + weaver uber JAR builds now use dependencies in the POM
in order to deal with creating binary + source assemblies. They no
longer rely on manually updated copies under 'lib'. Details:
  - Binaries are copied via 'dependencySets' in the assembly descriptor.
  - Sources are unzipped via Maven Dependency Plugin before including
    them into the source uber JAR via assembly descriptor.
  - NEW: This also includes ASM-renamed sources which so far were
    ignored. It is a positive side-effect from the fact that for
    ASM-renamed Maven Shade automatically creates a source JAR.
  - Maven Ant Run is no longer used for unzipping binary + source JARs.
  - While working in parallel with JDT Core and AspectJ it is now much
    easier to produce up to date artifacts, e.g. for consumption by
    AJDT, because it does not matter anymore if we forget to run the
    build in module 'lib' in order to update the JDT Core copy.

Status quo:
  - Folder lib/asm is no longer used and will be removed in a subsequent
    commit.
  - Folder lib/jdtcore-aj is no longer used by the Maven build, but
    still referenced in a few UNIX shell scripts and Ant build files.
    TODO: Find out if those are still actively used. If yes, refactor
    them to look for the file in the local Mavven repository. Otherwise,
    delete the referencing files and also lib/jdtcore-aj.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
12 files changed:
aspectjmatcher/aspectjmatcher-assembly.xml
aspectjmatcher/aspectjmatcher-sources-assembly.xml
aspectjmatcher/pom.xml
aspectjrt/aspectjrt-assembly.xml
aspectjrt/aspectjrt-sources-assembly.xml
aspectjtools/aspectjtools-assembly.xml
aspectjtools/aspectjtools-sources-assembly.xml
aspectjtools/pom.xml
aspectjweaver/aspectjweaver-assembly.xml
aspectjweaver/aspectjweaver-sources-assembly.xml
aspectjweaver/pom.xml
installer/aspectjinstaller-assembly.xml

index 2a95e6fd1946ebe38196851fa707657eb8d49ea5..3146028d217f70ded3da75e428170f15ee5e08ba 100644 (file)
@@ -1,13 +1,13 @@
-<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
 
        <id>aspectjmatcher</id>
-       
+
        <formats>
                <format>jar</format>
        </formats>
-       
+
        <includeBaseDirectory>false</includeBaseDirectory>
 
        <fileSets>
index cb55a46679c5b990806601aefce4c8f29b8dedbf..c3f925a4a8dd8000cef283218abaf83a5a173638 100644 (file)
@@ -1,8 +1,8 @@
-<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
 
-       <id>sources</id>
+<id>aspectjmatcher-sources</id>
 
        <formats>
                <format>jar</format>
index 06597f41c4cf64779b0ce6f455030e3b72a2fef6..3aa998b6c3c1f8b9986172689417f92c9542cb9e 100644 (file)
                                </executions>
                        </plugin>
 
-
-                       <!--
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-antrun-plugin</artifactId>
-        <version>3.0.0</version>
-                               <executions>
-                                       <execution>
-                                               <id>unzipasm</id>
-                                               <phase>prepare-package</phase>
-                                               <configuration>
-                                                       <target>
-                                                               <echo message="unzip jarjar'd asm" />
-                                                               <unzip
-                                                                       src="${project.basedir}/../lib/asm/asm-9.1.renamed.jar"
-                                                                       dest="target/asm-unzipped" />
-                                                       </target>
-                                               </configuration>
-                                               <goals>
-                                                       <goal>run</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                       </plugin>
-                       -->
-
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-assembly-plugin</artifactId>
index d4108da92d225dc29505f8e682378b234476a032..5c3e417136851f8f21e6e6de0646be6611b90064 100644 (file)
@@ -1,6 +1,6 @@
-<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
 
        <id>aspectjrt</id>
 
index ec393398e57d011d7588eee35de01ac00cf7b546..b4c13e2a923c0f23459149f24a68f8eff5b92909 100644 (file)
@@ -1,8 +1,8 @@
-<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
 
-       <id>sources</id>
+<id>aspectjrt-sources</id>
 
        <formats>
                <format>jar</format>
index 310dbe0988be889001ef9b8e285fd1e95f7d9567..fbf45c8085f68fb94fa9d26b0ee66587cf083e40 100644 (file)
@@ -1,15 +1,25 @@
-<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
 
        <id>aspectjtools</id>
-       
+
        <formats>
                <format>jar</format>
        </formats>
 
        <includeBaseDirectory>false</includeBaseDirectory>
 
+       <dependencySets>
+               <dependencySet>
+                       <unpack>true</unpack>
+                       <includes>
+                               <include>org.aspectj:org.eclipse.jdt.core</include>
+                               <include>org.aspectj:asm-renamed</include>
+                       </includes>
+               </dependencySet>
+       </dependencySets>
+
        <fileSets>
                <!-- runtime -->
                <fileSet>
                                <exclude>META-INF/maven/**</exclude>
                        </excludes>
                </fileSet>
-               <fileSet>
-                       <directory>target/asm-unzipped</directory>
-                       <outputDirectory>.</outputDirectory>
-                       <excludes>
-                               <exclude>META-INF/maven/**</exclude>
-                               <exclude>org/**</exclude>
-                               <exclude>META-INF/MANIFEST.MF</exclude>
-                       </excludes>
-               </fileSet>
-               
+
                <!-- tools -->
                <fileSet>
                        <directory>../ajbrowser/target/classes</directory>
                                <exclude>META-INF/maven/**</exclude>
                        </excludes>
                </fileSet>
-               <fileSet>
-                       <directory>target/jdtcore-unzipped</directory>
-                       <outputDirectory>.</outputDirectory>
-                       <excludes>
-                               <exclude>META-INF/MANIFEST.MF</exclude>
-                       </excludes>
-               </fileSet>
        </fileSets>
 
 </assembly>
index a382e5e8bdb521bb2fd681399aa6f477d652d80f..7b54c09b25be2f2bcde4b4e8e05dc7639d0a5ad3 100644 (file)
@@ -1,8 +1,8 @@
-<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
 
-       <id>sources</id>
+<id>aspectjtools-sources</id>
 
        <formats>
                <format>jar</format>
@@ -11,6 +11,7 @@
        <includeBaseDirectory>false</includeBaseDirectory>
 
        <fileSets>
+
                <fileSet>
                        <directory>../weaver/src/main/java</directory>
                        <outputDirectory>.</outputDirectory>
                        <directory>../loadtime/src/main/java</directory>
                        <outputDirectory>.</outputDirectory>
                </fileSet>
-               <!-- 
-               <fileSet>
-                       <directory>target/asm-unzipped</directory>
-                       <outputDirectory>.</outputDirectory>
-               </fileSet>
-                -->
-                
-               <!-- tools -->
+
+               <!-- Tools -->
                <fileSet>
                        <directory>../ajbrowser/src/main/java</directory>
                        <outputDirectory>.</outputDirectory>
                        <directory>../taskdefs/src/main/java</directory>
                        <outputDirectory>.</outputDirectory>
                </fileSet>
+
+               <!-- Dependencies -->
                <fileSet>
-                       <directory>target/jdtcore-unzipped-src</directory>
+                       <directory>target/unzipped-sources</directory>
                        <outputDirectory>.</outputDirectory>
                </fileSet>
+
        </fileSets>
 
 </assembly>
index b14b2fe01af92e2d740f15a5502e236528cbdb79..cac9b9e2ff13a738b889ec69a569bfed5eab90ad 100644 (file)
        <packaging>pom</packaging>
        <name>AspectJ Compiler</name>
 
-       <dependencies>
-               <dependency>
-                       <groupId>org.aspectj</groupId>
-                       <artifactId>org.aspectj.ajdt.core</artifactId>
-                       <version>${project.version}</version>
-               </dependency>
-       </dependencies>
-
        <build>
                <plugins>
 
                                </executions>
                        </plugin>
 
-
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-antrun-plugin</artifactId>
-                               <version>3.0.0</version>
+                               <artifactId>maven-dependency-plugin</artifactId>
                                <executions>
                                        <execution>
-                                               <id>unzipasm</id>
-                                               <phase>prepare-package</phase>
-                                               <configuration>
-                                                       <target>
-                                                               <echo message="unzip jarjar'd asm" />
-                                                               <unzip
-                                                                       src="${project.basedir}/../lib/asm/asm-9.1.renamed.jar"
-                                                                       dest="target/asm-unzipped" />
-                                                       </target>
-                                               </configuration>
+                                               <id>unzip-dependency-sources</id>
                                                <goals>
-                                                       <goal>run</goal>
+                                                       <goal>unpack-dependencies</goal>
                                                </goals>
-                                       </execution>
-
-                                       <execution>
-                                               <id>unzipjdt</id>
                                                <phase>prepare-package</phase>
                                                <configuration>
-                                                       <target>
-                                                               <echo message="unzip patched jdtcore" />
-                                                               <unzip
-                                                                       src="${project.basedir}/../lib/jdtcore-aj/jdtcore-for-aspectj.jar"
-                                                                       dest="target/jdtcore-unzipped" />
-                                                       </target>
-                                               </configuration>
-                                               <goals>
-                                                       <goal>run</goal>
-                                               </goals>
-                                       </execution>
-
-                                       <execution>
-                                               <id>unzipjdtsrc</id>
-                                               <phase>prepare-package</phase>
-                                               <configuration>
-                                                       <target>
-                                                               <echo message="unzip patched jdtcore sources" />
-                                                               <unzip
-                                                                       src="${project.basedir}/../lib/jdtcore-aj/jdtcore-for-aspectj-src.zip"
-                                                                       dest="target/jdtcore-unzipped-src" />
-                                                       </target>
+                                                       <classifier>sources</classifier>
+                                                       <!--<failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>-->
+                                                       <includeArtifactIds>org.eclipse.jdt.core,asm-renamed</includeArtifactIds>
+                                                       <outputDirectory>${project.build.directory}/unzipped-sources</outputDirectory>
+                                                       <!-- Avoid accidentally shading test-scoped dependencies like JUnit -->
+                                                       <includeScope>runtime</includeScope>
                                                </configuration>
-                                               <goals>
-                                                       <goal>run</goal>
-                                               </goals>
                                        </execution>
                                </executions>
                        </plugin>
 
                </plugins>
        </build>
+
+       <dependencies>
+               <dependency>
+                       <groupId>org.aspectj</groupId>
+                       <artifactId>org.aspectj.ajdt.core</artifactId>
+                       <version>${project.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.aspectj</groupId>
+                       <artifactId>org.eclipse.jdt.core</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.aspectj</groupId>
+                       <artifactId>asm-renamed</artifactId>
+               </dependency>
+       </dependencies>
+
 </project>
index af08bc45cca57d7550b19c1136767e7420ef2f59..4130c3c32d9547c1f48fb56eae1f7eb95ca8ec55 100644 (file)
@@ -1,15 +1,24 @@
-<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
 
        <id>aspectjweaver</id>
-       
+
        <formats>
                <format>jar</format>
        </formats>
-       
+
        <includeBaseDirectory>false</includeBaseDirectory>
 
+       <dependencySets>
+               <dependencySet>
+                       <unpack>true</unpack>
+                       <includes>
+                               <include>org.aspectj:asm-renamed</include>
+                       </includes>
+               </dependencySet>
+       </dependencySets>
+
        <fileSets>
                <fileSet>
                        <directory>../weaver/target/classes</directory>
                                <exclude>META-INF/maven/**</exclude>
                        </excludes>
                </fileSet>
-               <fileSet>
-                       <directory>target/asm-unzipped</directory>
-                       <outputDirectory>.</outputDirectory>
-                       <excludes>
-                               <exclude>META-INF/maven/**</exclude>
-                               <exclude>org/**</exclude>
-                               <exclude>META-INF/MANIFEST.MF</exclude>
-                       </excludes>
-               </fileSet>
        </fileSets>
 
 </assembly>
index 17e112d39b5564808eab403c3820aad8cad93d90..e1760dfe51707f390e1804b963995126cdebeb77 100644 (file)
@@ -1,8 +1,8 @@
-<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
 
-       <id>sources</id>
+<id>aspectjweaver-sources</id>
 
        <formats>
                <format>jar</format>
                        <directory>../loadtime/src/main/java</directory>
                        <outputDirectory>.</outputDirectory>
                </fileSet>
-               <!-- 
+               <!-- Dependencies -->
                <fileSet>
-                       <directory>target/asm-unzipped</directory>
+                       <directory>target/unzipped-sources</directory>
                        <outputDirectory>.</outputDirectory>
                </fileSet>
-                -->
        </fileSets>
 
 </assembly>
index da4b3b2331a257d42310f87bd70d65e345304e79..9214016915c1ab1298966537e1a09949289cb258 100644 (file)
        <packaging>pom</packaging>
        <name>AspectJ Weaver</name>
 
-       <dependencies>
-               <dependency>
-                       <groupId>org.aspectj</groupId>
-                       <artifactId>weaver</artifactId>
-                       <version>${project.version}</version>
-               </dependency>
-       </dependencies>
-
        <build>
                <plugins>
 
                                </executions>
                        </plugin>
 
-
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-antrun-plugin</artifactId>
-                               <version>3.0.0</version>
+                               <artifactId>maven-dependency-plugin</artifactId>
                                <executions>
                                        <execution>
-                                               <id>unzipasm</id>
+                                               <id>unzip-dependency-sources</id>
+                                               <goals>
+                                                       <goal>unpack-dependencies</goal>
+                                               </goals>
                                                <phase>prepare-package</phase>
                                                <configuration>
-                                                       <target>
-                                                               <echo message="unzip jarjar'd asm" />
-                                                               <unzip
-                                                                       src="${project.basedir}/../lib/asm/asm-9.1.renamed.jar"
-                                                                       dest="target/asm-unzipped" />
-                                                       </target>
+                                                       <classifier>sources</classifier>
+                                                       <!--<failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>-->
+                                                       <includeArtifactIds>asm-renamed</includeArtifactIds>
+                                                       <outputDirectory>${project.build.directory}/unzipped-sources</outputDirectory>
+                                                       <!-- Avoid accidentally shading test-scoped dependencies like JUnit -->
+                                                       <includeScope>runtime</includeScope>
                                                </configuration>
-                                               <goals>
-                                                       <goal>run</goal>
-                                               </goals>
                                        </execution>
                                </executions>
                        </plugin>
@@ -82,7 +72,6 @@
                                                                        <Can-Redefine-Classes>true</Can-Redefine-Classes>
                                                                </manifestEntries>
 
-
                                                                <manifestSections>
                                                                        <manifestSection>
                                                                                <name>org/aspectj/weaver/</name>
 
                </plugins>
        </build>
+
+       <dependencies>
+               <dependency>
+                       <groupId>org.aspectj</groupId>
+                       <artifactId>weaver</artifactId>
+                       <version>${project.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.aspectj</groupId>
+                       <artifactId>asm-renamed</artifactId>
+               </dependency>
+       </dependencies>
+
 </project>
index 2927dd6183dc9ac886e428785eed72fc90248a31..f7255b34563be34ec3dd894d13c435f6a2255fb0 100644 (file)
@@ -1,6 +1,6 @@
-<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+       xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
 
        <id>aspectjinstaller</id>
        <formats>
@@ -20,7 +20,7 @@
                        <directory>../aj-build/dist/docs</directory>
                        <outputDirectory>files</outputDirectory>
                </fileSet>
-               
+
                <fileSet>
                        <directory>../runtime/target/site/apidocs</directory>
                        <outputDirectory>files/doc/runtime-apidocs</outputDirectory>