aboutsummaryrefslogtreecommitdiffstats
path: root/asm-renamed/pom.xml
blob: e62b985655e86527489ba4cfdf82cc383486dae9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<?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.7.BUILD-SNAPSHOT</version>
  </parent>

  <artifactId>asm-renamed</artifactId>
  <version>${asm.version}</version>

  <name>ASM for AspectJ</name>
  <description>
    This module relocates the original ASM artifact from package name 'org.objectweb.asm' to 'aj.org.objectweb.asm',
    using Maven Shade Plugin.

    In order to avoid committing the binary to the AspectJ SCM repository and using it as a system-scoped dependency, we
    deploy it to and Sonatype OSSRH separately, promoting releases to Maven Central. From there it can be consumed by
    the main AspectJ build.

    Whenever it is necessary to upgrade to a new ASM version in order to make AspectJ compatible with a new Java
    version, please build and deploy this module after upgrading property 'asm.version'.

    Caveat for IntelliJ IDEA: The project cannot be built in IDEA (Ctrl-F9) if this module is visible in the Maven view.
    If so, right-click it and select "Unlink Maven Projects". Unfortunately, "Ignore Projects" is not enough. If Maven
    knows of this Maven module, it cannot compile other modules depending on shaded class names, because it cannot find
    the binaries. IDEA will just stop looking at the local Maven repository in this case.
  </description>
  <url>https://www.eclipse.org/aspectj/</url>

  <licenses>
    <!--
      Even though we release the package-relocated version under the 'org.aspectj' group ID, we do respect the original
      licence, hence BSD-3 and not Eclipse
    -->
    <license>
      <name>BSD-3-Clause</name>
      <url>https://asm.ow2.io/license.html</url>
    </license>
  </licenses>

  <developers>
    <!--
      AspectJ developers only. For a list of original developers, mailing lists, SCM, issue management information etc.,
      please see the original upstream POM, e.g. https://repo1.maven.org/maven2/org/ow2/asm/asm/9.1/asm-9.1.pom
    -->
    <developer>
      <id>aclement</id>
      <name>Andy Clement</name>
      <email>aclement@vmware.com</email>
    </developer>
    <developer>
      <id>kriegaex</id>
      <name>Alexander Kriegisch</name>
      <email>kriegaex@aspectj.dev</email>
    </developer>
  </developers>

  <scm>
    <url>https://github.com/eclipse/org.aspectj</url>
    <connection>scm:git:https://github.com/eclipse/org.aspectj.git</connection>
    <developerConnection>scm:git:ssh://git@github.com:eclipse/org.aspectj.git</developerConnection>
  </scm>

  <properties>
    <!-- By default, do not deploy artifacts - but deploy this one used by the main build -->
    <maven.deploy.skip>false</maven.deploy.skip>
  </properties>

  <build>
    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <!-- Nothing to compile in this module -->
          <execution>
            <id>default-compile</id>
            <phase>none</phase>
          </execution>
          <execution>
            <id>default-testCompile</id>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <configuration>
          <!-- Re-create original source JAR in order to avoid re-shading already shaded JAR in non-clean builds -->
          <forceCreation>true</forceCreation>
          <!--
            Avoid attaching the source JAR here, because Maven Shade will add the source uber JAR later. Because both
            JARs have the same final name, Maven Install/Deploy would see two artifacts attached to the build, which
            would lead to double deployment and hence to an error "Transfer failed for ...-sources.jar 409 Conflict".
            See also https://issues.apache.org/jira/browse/MDEPLOY-254 and comments by Alexander Kriegisch.
          -->
          <attach>false</attach>
          <archive>
            <addMavenDescriptor>false</addMavenDescriptor>
          </archive>
        </configuration>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>package</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <addMavenDescriptor>false</addMavenDescriptor>
          </archive>
          <!-- Re-create original JAR in order to avoid re-shading already shaded JAR in non-clean builds -->
          <forceCreation>true</forceCreation>
        </configuration>
        <executions>
          <execution>
            <!-- Avoid creating test JAR -->
            <id>test-jar</id>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <configuration>
          <createSourcesJar>true</createSourcesJar>
          <!-- Flatten Maven plugin takes care of customising the POM for deployment -->
          <createDependencyReducedPom>false</createDependencyReducedPom>
          <shadedArtifactAttached>false</shadedArtifactAttached>
        </configuration>
        <executions>
          <execution>
            <id>asm-relocate</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <minimizeJar>false</minimizeJar>
              <shadeSourcesContent>true</shadeSourcesContent>
              <artifactSet>
                <excludes>
                  <exclude>${project.groupId}</exclude>
                </excludes>
              </artifactSet>
              <filters>
                <filter>
                  <artifact>*</artifact>
                  <excludes>
                    <exclude>META-INF/*</exclude>
                  </excludes>
                </filter>
              </filters>
              <relocations>
                <relocation>
                  <pattern>org.objectweb.asm</pattern>
                  <shadedPattern>aj.org.objectweb.asm</shadedPattern>
                </relocation>
              </relocations>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>truezip-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>unzip-relocated-sources</id>
            <phase>package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <!--
                Skip, if javadoc generation is also meant to be skipped, which is the default unless the 'release'
                profile is active or the property is overridden manually to be false. See property definitions in parent
                POM for default case and release profile.
              -->
              <skip>${maven.javadoc.skip}</skip>
              <verbose>true</verbose>
              <fileset>
                <directory>${project.build.directory}/${project.build.finalName}-sources.jar</directory>
                <outputDirectory>${project.build.directory}/unpacked-sources</outputDirectory>
              </fileset>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.2.0</version>
        <executions>
          <execution>
            <id>javadoc-jar</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <sourcepath>${project.build.directory}/unpacked-sources</sourcepath>
              <!-- Deactivate doclint checks in order to suppress errors -->
              <doclint>none</doclint>
              <subpackages>aj</subpackages>
              <javadocVersion>8</javadocVersion>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
        <version>1.2.2</version>
        <executions>
          <!-- Remove shaded dependencies from uber JAR -->
          <execution>
            <id>flatten</id>
            <phase>process-resources</phase>
            <goals>
              <goal>flatten</goal>
            </goals>
            <configuration>
              <flattenMode>oss</flattenMode>
              <pomElements>
                <dependencies>remove</dependencies>
                <repositories>remove</repositories>
              </pomElements>
              <outputDirectory>${project.build.directory}</outputDirectory>
              <flattenedPomFilename>flattened-pom.xml</flattenedPomFilename>
            </configuration>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm</artifactId>
    </dependency>
  </dependencies>

</project>