ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1796490 - in /webservices/axiom/trunk: aspects/ buildutils/class-postprocessor-maven-plugin/src/main/java/org/apache/axiom/buildutils/classes/ implementations/axiom-dom/ implementations/axiom-impl/ implementations/fom-impl/
Date Sun, 28 May 2017 13:34:24 GMT
Author: veithen
Date: Sun May 28 13:34:24 2017
New Revision: 1796490

URL: http://svn.apache.org/viewvc?rev=1796490&view=rev
Log:
Remove AspectJ runtime code from JARs.

Added:
    webservices/axiom/trunk/buildutils/class-postprocessor-maven-plugin/src/main/java/org/apache/axiom/buildutils/classes/AspectJCodeRemover.java
  (with props)
Modified:
    webservices/axiom/trunk/aspects/pom.xml
    webservices/axiom/trunk/buildutils/class-postprocessor-maven-plugin/src/main/java/org/apache/axiom/buildutils/classes/PostProcessMojo.java
    webservices/axiom/trunk/implementations/axiom-dom/pom.xml
    webservices/axiom/trunk/implementations/axiom-impl/pom.xml
    webservices/axiom/trunk/implementations/fom-impl/pom.xml

Modified: webservices/axiom/trunk/aspects/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/pom.xml?rev=1796490&r1=1796489&r2=1796490&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/pom.xml (original)
+++ webservices/axiom/trunk/aspects/pom.xml Sun May 28 13:34:24 2017
@@ -76,6 +76,18 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>${project.groupId}</groupId>
+                <artifactId>class-postprocessor-maven-plugin</artifactId>
+                <version>${project.version}</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>post-process</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 </project>

Added: webservices/axiom/trunk/buildutils/class-postprocessor-maven-plugin/src/main/java/org/apache/axiom/buildutils/classes/AspectJCodeRemover.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/buildutils/class-postprocessor-maven-plugin/src/main/java/org/apache/axiom/buildutils/classes/AspectJCodeRemover.java?rev=1796490&view=auto
==============================================================================
--- webservices/axiom/trunk/buildutils/class-postprocessor-maven-plugin/src/main/java/org/apache/axiom/buildutils/classes/AspectJCodeRemover.java
(added)
+++ webservices/axiom/trunk/buildutils/class-postprocessor-maven-plugin/src/main/java/org/apache/axiom/buildutils/classes/AspectJCodeRemover.java
Sun May 28 13:34:24 2017
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.buildutils.classes;
+
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+
+final class AspectJCodeRemover extends ClassVisitor {
+    public AspectJCodeRemover(ClassVisitor cv) {
+        super(Opcodes.ASM5, cv);
+    }
+
+    @Override
+    public MethodVisitor visitMethod(int access, String name, String desc, String signature,
String[] exceptions) {
+        if (access == (Opcodes.ACC_STATIC | Opcodes.ACC_PUBLIC)
+                && (name.equals("aspectOf") || name.equals("hasAspect"))) {
+            return null;
+        } else {
+            return super.visitMethod(access, name, desc, signature, exceptions);
+        }
+    }
+}

Propchange: webservices/axiom/trunk/buildutils/class-postprocessor-maven-plugin/src/main/java/org/apache/axiom/buildutils/classes/AspectJCodeRemover.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axiom/trunk/buildutils/class-postprocessor-maven-plugin/src/main/java/org/apache/axiom/buildutils/classes/PostProcessMojo.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/buildutils/class-postprocessor-maven-plugin/src/main/java/org/apache/axiom/buildutils/classes/PostProcessMojo.java?rev=1796490&r1=1796489&r2=1796490&view=diff
==============================================================================
--- webservices/axiom/trunk/buildutils/class-postprocessor-maven-plugin/src/main/java/org/apache/axiom/buildutils/classes/PostProcessMojo.java
(original)
+++ webservices/axiom/trunk/buildutils/class-postprocessor-maven-plugin/src/main/java/org/apache/axiom/buildutils/classes/PostProcessMojo.java
Sun May 28 13:34:24 2017
@@ -43,6 +43,9 @@ public class PostProcessMojo extends Abs
 
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
+        if (!classesDir.exists()) {
+            return;
+        }
         DirectoryScanner ds = new DirectoryScanner();
         ds.setIncludes(new String[] { "**/*.class" });
         ds.setBasedir(classesDir);
@@ -59,6 +62,7 @@ public class PostProcessMojo extends Abs
                     if (relativePath.equals("org/apache/axiom/om/OMText.class")) {
                         classVisitor = new GetDataHandlerBridgeMethodInjector(classVisitor);
                     }
+                    classVisitor = new AspectJCodeRemover(classVisitor);
                     classReader.accept(classVisitor, 0);
                 } finally {
                     in.close();

Modified: webservices/axiom/trunk/implementations/axiom-dom/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/pom.xml?rev=1796490&r1=1796489&r2=1796490&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/pom.xml (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/pom.xml Sun May 28 13:34:24 2017
@@ -128,9 +128,7 @@
                             org.apache.axiom.soap.impl.*,
                             org.apache.axiom.dom.*,
                             org.apache.axiom.shared.*,
-                            org.apache.axiom.util.xml.*,
-                            org.aspectj.lang,
-                            org.aspectj.lang.annotation
+                            org.apache.axiom.util.xml.*
                         </Private-Package>
                     </instructions>
                 </configuration>

Modified: webservices/axiom/trunk/implementations/axiom-impl/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/pom.xml?rev=1796490&r1=1796489&r2=1796490&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/pom.xml (original)
+++ webservices/axiom/trunk/implementations/axiom-impl/pom.xml Sun May 28 13:34:24 2017
@@ -111,9 +111,7 @@
                             org.apache.axiom.om.impl.*,
                             org.apache.axiom.soap.impl.*,
                             org.apache.axiom.shared.*,
-                            org.apache.axiom.util.xml.*,
-                            org.aspectj.lang,
-                            org.aspectj.lang.annotation
+                            org.apache.axiom.util.xml.*
                         </Private-Package>
                     </instructions>
                 </configuration>

Modified: webservices/axiom/trunk/implementations/fom-impl/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/pom.xml?rev=1796490&r1=1796489&r2=1796490&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/pom.xml (original)
+++ webservices/axiom/trunk/implementations/fom-impl/pom.xml Sun May 28 13:34:24 2017
@@ -146,9 +146,7 @@
                             org.apache.axiom.soap.impl.*,
                             org.apache.axiom.shared.*,
                             org.apache.axiom.fom.*,
-                            org.apache.axiom.util.xml.*,
-                            org.aspectj.lang,
-                            org.aspectj.lang.annotation
+                            org.apache.axiom.util.xml.*
                         </Private-Package>
                     </instructions>
                 </configuration>



Mime
View raw message