]> source.dussan.org Git - aspectj.git/commitdiff
Recreate lib/commons from Apache Commons downloads
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Mon, 29 Mar 2021 05:45:27 +0000 (12:45 +0700)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Mon, 29 Mar 2021 06:52:01 +0000 (13:52 +0700)
Project archeology, binary and source code comparisons of contents in
lib/commons/commons.jar and lib/commons/commons-src.zip yielded the
following results:
  - All binaries are available on Maven Central in 4 different legacy
    Apache Commons dependencies:
      * commons-beanutils:commons-beanutils:1.4
      * commons-collections:commons-collections:2.0
      * commons-digester:commons-digester:1.3
      * commons-logging:commons-logging:1.0.1
  - Those Maven Central binaries are not accompanied by source JARs,
    i.e. in order to recreate lib/commons/commons-src.zip we have to
    download source archives from the corresponding Git tags. All
    projects are available on GitHub, so it is possible to download them
    using Maven Download Plugin.
  - Both the compound binaries and compound sources archives currently
    checked in in AspectJ can be recreated using TrueZIP Maven Plugin.
    This is rather tedious and involves additional Maven profiles in
    order not to generate the compound archives during every build, but
    fully implemented now.

Unfortunately, all of the above does not make the system-scoped
dependency on commons.jar obsolete. In order to achieve that, we either
have to publish the compound files on Maven Central or GitHub Packages,
or we find out which AspectJ modules use classes from which of the 4
individual Apache Commons packages and replace the compound system
dependency by the relevant single dependencies. Probably I am going to
try that in a next step.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
libx/pom.xml

index 987ae1d11f952aabd89e804111c569c15337843c..676fb9edfbb00bc2659c0d9a374c8ab471b9eaea 100644 (file)
               <sha1>b9f3c8c31bb6c9069ad5b655059a17769af12f20</sha1>
             </configuration>
           </execution>
+          <execution>
+            <id>download-beanutils-sources</id>
+            <phase>generate-resources</phase>
+            <goals>
+              <goal>wget</goal>
+            </goals>
+            <configuration>
+              <url>https://github.com/apache/commons-beanutils/archive/refs/tags/BEANUTILS_1_4.zip</url>
+              <outputDirectory>commons</outputDirectory>
+              <outputFileName>commons-beanutils-1.4-sources.jar</outputFileName>
+              <sha1>b2c02afe7e6475cd7c811932b8415d171a8afa00</sha1>
+            </configuration>
+          </execution>
+          <execution>
+            <id>download-collections-sources</id>
+            <phase>generate-resources</phase>
+            <goals>
+              <goal>wget</goal>
+            </goals>
+            <configuration>
+              <url>https://github.com/apache/commons-collections/archive/refs/tags/collections-2.0.zip</url>
+              <outputDirectory>commons</outputDirectory>
+              <outputFileName>commons-collections-2.0-sources.jar</outputFileName>
+              <sha1>824cacd0aafe21a94fb142388fd62f28a12df5ef</sha1>
+            </configuration>
+          </execution>
+          <execution>
+            <id>download-digester-sources</id>
+            <phase>generate-resources</phase>
+            <goals>
+              <goal>wget</goal>
+            </goals>
+            <configuration>
+              <url>https://github.com/apache/commons-digester/archive/refs/tags/DIGESTER_1_3.zip</url>
+              <outputDirectory>commons</outputDirectory>
+              <outputFileName>commons-digester-1.3-sources.jar</outputFileName>
+              <sha1>49f653c7ea726301c564f9662b72c051fee9390a</sha1>
+            </configuration>
+          </execution>
+          <execution>
+            <id>download-logging-sources</id>
+            <phase>generate-resources</phase>
+            <goals>
+              <goal>wget</goal>
+            </goals>
+            <configuration>
+              <url>https://github.com/apache/commons-logging/archive/refs/tags/LOGGING_1_0_1.zip</url>
+              <outputDirectory>commons</outputDirectory>
+              <outputFileName>commons-logging-1.0.1-sources.jar</outputFileName>
+              <sha1>c61a373f6d50ff8fcfba900934f7254d44f9735b</sha1>
+            </configuration>
+          </execution>
         </executions>
       </plugin>
 
                   <outputDirectory>regexp</outputDirectory>
                   <destFileName>jakarta-regexp-1.2.jar</destFileName>
                 </artifactItem>
+
+                <!--
+                  About commons.jar + commons-src.zip:
+                    - Beanutils Binaries are commons-beanutils:commons-beanutils:1.4 (no sources on Maven Central, but
+                      https://github.com/apache/commons-beanutils/archive/refs/tags/BEANUTILS_1_4.zip)
+                    - Collections: Binaries are commons-collections:commons-collections:2.0 (no sources on Maven Central, but
+                      https://github.com/apache/commons-collections/archive/refs/tags/collections-2.0.zip)
+                    - Digester: Binaries are commons-digester:commons-digester:1.3 (no sources on Maven Central, but
+                      https://github.com/apache/commons-digester/archive/refs/tags/DIGESTER_1_3.zip)
+                    - Logging: Binaries are commons-logging:commons-logging:1.0.1 (no sources on Maven Central, but
+                      https://github.com/apache/commons-logging/archive/refs/tags/LOGGING_1_0_1.zip)
+                -->
+                <artifactItem>
+                  <!-- Binary is identical to committed version -->
+                  <!-- TODO: not used anywhere -> remove -->
+                  <groupId>commons-beanutils</groupId>
+                  <artifactId>commons-beanutils</artifactId>
+                  <version>1.4</version>
+                  <type>jar</type>
+                  <overWrite>false</overWrite>
+                  <outputDirectory>commons</outputDirectory>
+                  <destFileName>commons-beanutils-1.4.jar</destFileName>
+                </artifactItem>
+                <artifactItem>
+                  <!-- Binary is identical to committed version -->
+                  <!-- TODO: not used anywhere -> remove -->
+                  <groupId>commons-collections</groupId>
+                  <artifactId>commons-collections</artifactId>
+                  <version>2.0</version>
+                  <type>jar</type>
+                  <overWrite>false</overWrite>
+                  <outputDirectory>commons</outputDirectory>
+                  <destFileName>commons-collections-2.0.jar</destFileName>
+                </artifactItem>
+                <artifactItem>
+                  <!-- Binary is identical to committed version -->
+                  <!-- TODO: used in module 'testing' -->
+                  <groupId>commons-digester</groupId>
+                  <artifactId>commons-digester</artifactId>
+                  <version>1.3</version>
+                  <type>jar</type>
+                  <overWrite>false</overWrite>
+                  <outputDirectory>commons</outputDirectory>
+                  <destFileName>commons-digester-1.3.jar</destFileName>
+                </artifactItem>
+                <artifactItem>
+                  <!-- Binary is identical to committed version -->
+                  <!-- TODO: used in modules 'org.aspectj.matcher', 'testing'   -->
+                  <groupId>commons-logging</groupId>
+                  <artifactId>commons-logging</artifactId>
+                  <version>1.0.1</version>
+                  <type>jar</type>
+                  <overWrite>false</overWrite>
+                  <outputDirectory>commons</outputDirectory>
+                  <destFileName>commons-logging-1.0.1.jar</destFileName>
+                </artifactItem>
+
               </artifactItems>
             </configuration>
           </execution>
     </profile>
 
     <profile>
-      <id>unzip-ant-sources</id>
+      <id>zip-ant-sources</id>
       <activation>
         <file>
-          <!-- Only unzip if this file is missing in order to avoid doing it for each build -->
+          <!-- Only create archive if this file is missing in order to avoid doing it for each build -->
           <missing>ant/ant-src.zip</missing>
         </file>
       </activation>
             <version>1.2</version>
             <executions>
               <execution>
-                <id>unzip-ant-sources</id>
+                <id>zip-ant-sources</id>
                 <phase>process-resources</phase>
                 <goals>
                   <goal>copy</goal>
       </build>
     </profile>
 
+    <profile>
+      <id>zip-commons-binaries</id>
+      <activation>
+        <file>
+          <!-- Only create archive if this file is missing in order to avoid doing it for each build -->
+          <missing>commons/commons.jar</missing>
+        </file>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>truezip-maven-plugin</artifactId>
+            <version>1.2</version>
+            <executions>
+              <execution>
+                <id>zip-beanutils-binaries</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>copy</goal>
+                </goals>
+                <configuration>
+                  <verbose>true</verbose>
+                  <fileset>
+                    <!--
+                      This is why we use the TrueZIP plugin: It can seamlessly copy out of or into ZIP files as if they
+                      were normal file system paths. No additional moves and deletes with Antrun are necessary.
+                    -->
+                    <directory>commons/commons-beanutils-1.4.jar</directory>
+                    <outputDirectory>commons/commons.jar</outputDirectory>
+                  </fileset>
+                </configuration>
+              </execution>
+              <execution>
+                <id>zip-collections-binaries</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>copy</goal>
+                </goals>
+                <configuration>
+                  <verbose>true</verbose>
+                  <fileset>
+                    <!--
+                      This is why we use the TrueZIP plugin: It can seamlessly copy out of or into ZIP files as if they
+                      were normal file system paths. No additional moves and deletes with Antrun are necessary.
+                    -->
+                    <directory>commons/commons-collections-2.0.jar</directory>
+                    <outputDirectory>commons/commons.jar</outputDirectory>
+                  </fileset>
+                </configuration>
+              </execution>
+              <execution>
+                <id>zip-digester-binaries</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>copy</goal>
+                </goals>
+                <configuration>
+                  <verbose>true</verbose>
+                  <fileset>
+                    <!--
+                      This is why we use the TrueZIP plugin: It can seamlessly copy out of or into ZIP files as if they
+                      were normal file system paths. No additional moves and deletes with Antrun are necessary.
+                    -->
+                    <directory>commons/commons-digester-1.3.jar</directory>
+                    <outputDirectory>commons/commons.jar</outputDirectory>
+                  </fileset>
+                </configuration>
+              </execution>
+              <execution>
+                <id>zip-logging-binaries</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>copy</goal>
+                </goals>
+                <configuration>
+                  <verbose>true</verbose>
+                  <fileset>
+                    <!--
+                      This is why we use the TrueZIP plugin: It can seamlessly copy out of or into ZIP files as if they
+                      were normal file system paths. No additional moves and deletes with Antrun are necessary.
+                    -->
+                    <directory>commons/commons-logging-1.0.1.jar</directory>
+                    <outputDirectory>commons/commons.jar</outputDirectory>
+                  </fileset>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+
+    <profile>
+      <id>zip-commons-sources</id>
+      <activation>
+        <file>
+          <!-- Only create archive if this file is missing in order to avoid doing it for each build -->
+          <missing>commons/commons-src.zip</missing>
+        </file>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>truezip-maven-plugin</artifactId>
+            <version>1.2</version>
+            <executions>
+              <execution>
+                <id>zip-beanutils-sources</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>copy</goal>
+                </goals>
+                <configuration>
+                  <verbose>true</verbose>
+                  <fileset>
+                    <!--
+                      This is why we use the TrueZIP plugin: It can seamlessly copy out of or into ZIP files as if they
+                      were normal file system paths. No additional moves and deletes with Antrun are necessary.
+                    -->
+                    <directory>commons/commons-beanutils-1.4-sources.jar/commons-beanutils-BEANUTILS_1_4/src/java</directory>
+                    <outputDirectory>commons/commons-src.zip</outputDirectory>
+                  </fileset>
+                </configuration>
+              </execution>
+              <execution>
+                <id>zip-collections-sources</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>copy</goal>
+                </goals>
+                <configuration>
+                  <verbose>true</verbose>
+                  <fileset>
+                    <!--
+                      This is why we use the TrueZIP plugin: It can seamlessly copy out of or into ZIP files as if they
+                      were normal file system paths. No additional moves and deletes with Antrun are necessary.
+                    -->
+                    <directory>commons/commons-collections-2.0-sources.jar/commons-collections-collections-2.0/src/java</directory>
+                    <outputDirectory>commons/commons-src.zip</outputDirectory>
+                  </fileset>
+                </configuration>
+              </execution>
+              <execution>
+                <id>zip-digester-sources</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>copy</goal>
+                </goals>
+                <configuration>
+                  <verbose>true</verbose>
+                  <fileset>
+                    <!--
+                      This is why we use the TrueZIP plugin: It can seamlessly copy out of or into ZIP files as if they
+                      were normal file system paths. No additional moves and deletes with Antrun are necessary.
+                    -->
+                    <directory>commons/commons-digester-1.3-sources.jar/commons-digester-DIGESTER_1_3/src/java</directory>
+                    <outputDirectory>commons/commons-src.zip</outputDirectory>
+                  </fileset>
+                </configuration>
+              </execution>
+              <execution>
+                <id>zip-logging-sources</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>copy</goal>
+                </goals>
+                <configuration>
+                  <verbose>true</verbose>
+                  <fileset>
+                    <!--
+                      This is why we use the TrueZIP plugin: It can seamlessly copy out of or into ZIP files as if they
+                      were normal file system paths. No additional moves and deletes with Antrun are necessary.
+                    -->
+                    <directory>commons/commons-logging-1.0.1-sources.jar/commons-logging-LOGGING_1_0_1/src/java</directory>
+                    <outputDirectory>commons/commons-src.zip</outputDirectory>
+                  </fileset>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+
     <!--
       TODO:
         - Add profile 'clean-libs' to make Maven Clean delete downloads & unpacks (should be off by default in order