From: Alexander Kriegisch Date: Mon, 26 Apr 2021 03:02:15 +0000 (+0700) Subject: Prepare main artifacts to be deployed via Maven, step 1 X-Git-Tag: V1_9_7_M2~21^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=18f3385e23b13b385edcbcc81dbb52623607dd8f;p=aspectj.git Prepare main artifacts to be deployed via Maven, step 1 This change affects the following modules: - aspectjmatcher - aspectjrt - aspectjtools - aspectjweaver - installer They have in common that they all use Maven Assembly Plugin in order to create some kind of uber JARs with constituent modules and/or libraries. Except for the installer, they are all available on Maven Central today, but I think it would not hurt to deploy the installer to there, too. Changes made: - Use Flatten Maven Plugin in order to create simple POMs with only basic information and - most importantly - without dependencies. - The new dependency-reduced POM (DRP) or "flattened POM" gets attached to the build, i.e. it will be installed and deployed as a replacement of the original POM. - Attaching the DRP only works for 'jar' type modules, which is why I changed the packaging type for each module from 'pom' to 'jar'. - Deactivate generation of the default JAR for each module. This is necessary now, since we have the 'jar' packaging type. - Make sure that assembly descriptors using 'dependencySet' entries have set option 'useProjectArtifact=false' in order to avoid warnings about the non-existing main artifact. TODO: - Explore option to migrate from Maven Assembly to Maven Shade, because it does not need descriptor files, can also generate source JARs and can automatically create and attach a DRP which is less fragmentary than the one created by Flatten Maven, basically the original JAR minus the dependencies. - If in the future we want to make sure to only deploy the modules listed above, e.g. to Maven Central, if simply calling 'mvn deploy' for the whole project, we could use 'maven.deploy.skip=true' in the parent POM and override it by 'maven.deploy.skip=false' just in the few modules which need to be deployed. See also: https://stackoverflow.com/a/29574812/1082681 Signed-off-by: Alexander Kriegisch --- diff --git a/aspectjmatcher/pom.xml b/aspectjmatcher/pom.xml index b183bd3d6..c398420af 100644 --- a/aspectjmatcher/pom.xml +++ b/aspectjmatcher/pom.xml @@ -11,17 +11,20 @@ aspectjmatcher - pom AspectJ Matcher - + org.apache.maven.plugins maven-jar-plugin + + default-jar + none + test-jar none @@ -116,6 +119,31 @@ + + + org.codehaus.mojo + flatten-maven-plugin + + + + flatten + process-resources + + flatten + + + oss + + remove + remove + + ${project.build.directory} + flattened-pom.xml + + + + + diff --git a/aspectjrt/pom.xml b/aspectjrt/pom.xml index 930ba02ca..5e41a1558 100644 --- a/aspectjrt/pom.xml +++ b/aspectjrt/pom.xml @@ -11,7 +11,6 @@ aspectjrt - pom AspectJ Runtime @@ -25,11 +24,15 @@ - + org.apache.maven.plugins maven-jar-plugin + + default-jar + none + test-jar none @@ -118,6 +121,31 @@ + + + org.codehaus.mojo + flatten-maven-plugin + + + + flatten + process-resources + + flatten + + + oss + + remove + remove + + ${project.build.directory} + flattened-pom.xml + + + + + diff --git a/aspectjtools/aspectjtools-assembly.xml b/aspectjtools/aspectjtools-assembly.xml index fbf45c808..9a6777509 100644 --- a/aspectjtools/aspectjtools-assembly.xml +++ b/aspectjtools/aspectjtools-assembly.xml @@ -13,6 +13,8 @@ true + + false org.aspectj:org.eclipse.jdt.core org.aspectj:asm-renamed diff --git a/aspectjtools/pom.xml b/aspectjtools/pom.xml index 62cf15ebf..7860f3a5a 100644 --- a/aspectjtools/pom.xml +++ b/aspectjtools/pom.xml @@ -11,17 +11,20 @@ aspectjtools - pom AspectJ Compiler - + org.apache.maven.plugins maven-jar-plugin + + default-jar + none + test-jar none @@ -132,6 +135,31 @@ + + + org.codehaus.mojo + flatten-maven-plugin + + + + flatten + process-resources + + flatten + + + oss + + remove + remove + + ${project.build.directory} + flattened-pom.xml + + + + + diff --git a/aspectjweaver/aspectjweaver-assembly.xml b/aspectjweaver/aspectjweaver-assembly.xml index 4130c3c32..332504316 100644 --- a/aspectjweaver/aspectjweaver-assembly.xml +++ b/aspectjweaver/aspectjweaver-assembly.xml @@ -13,6 +13,8 @@ true + + false org.aspectj:asm-renamed diff --git a/aspectjweaver/pom.xml b/aspectjweaver/pom.xml index 3552ab630..69952e3b4 100644 --- a/aspectjweaver/pom.xml +++ b/aspectjweaver/pom.xml @@ -11,17 +11,20 @@ aspectjweaver - pom AspectJ Weaver - + org.apache.maven.plugins maven-jar-plugin + + default-jar + none + test-jar none @@ -135,6 +138,31 @@ + + + org.codehaus.mojo + flatten-maven-plugin + + + + flatten + process-resources + + flatten + + + oss + + remove + remove + + ${project.build.directory} + flattened-pom.xml + + + + + diff --git a/installer/pom.xml b/installer/pom.xml index 977fa1d12..d8ada07d5 100644 --- a/installer/pom.xml +++ b/installer/pom.xml @@ -11,7 +11,6 @@ installer - pom AspectJ Installer @@ -24,11 +23,16 @@ - + + org.apache.maven.plugins maven-jar-plugin + + default-jar + none + test-jar none @@ -61,6 +65,32 @@ + + + + org.codehaus.mojo + flatten-maven-plugin + + + + flatten + process-resources + + flatten + + + oss + + remove + remove + + ${project.build.directory} + flattened-pom.xml + + + + + diff --git a/pom.xml b/pom.xml index 61f8d90ad..8f5a31b2a 100644 --- a/pom.xml +++ b/pom.xml @@ -216,6 +216,11 @@ maven-assembly-plugin 3.1.1 + + org.codehaus.mojo + flatten-maven-plugin + 1.2.2 +