Anonymous avatar Anonymous committed 176be79

XW-639 latest trunk does not build on Leopard with Java 6
o fixing build
o updating spring version to 2.5.4

NOTE: The required ASM 3.1 for the ClassFinder impl conflicts with the Spring dep on ASM 2.2.3
We need another solution for adding (possibly a jarjared )version of ASM3.1 as our dependency.
The shade plugin does not work for this kind of setup.

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@1792 e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (2)

         <url>http://jira.opensymphony.com/browse/XW</url>
     </issueManagement>
     <distributionManagement>
-	    <!--
-		For this to work, you need to:
+        <!--
+          For this to work, you need to:
 
-		1) Get the private key from someone that trusts you :)
-		2) Add the following to ~/.m2/settings.xml
+          1) Get the private key from someone that trusts you :)
+          2) Add the following to ~/.m2/settings.xml
 
-		<settings>
-			...
-			<servers>
-		    	<server>
-		      		<id>opensymphony</id>
-		      		<username>maven</username>
-		      		<privateKey>/path/to/private/maven_opensymphony_key</privateKey>
-		    	</server>
-			</servers>
-			...
-		</settings>
-		-->
+          <settings>
+              ...
+              <servers>
+                  <server>
+                        <id>opensymphony</id>
+                        <username>maven</username>
+                        <privateKey>/path/to/private/maven_opensymphony_key</privateKey>
+                  </server>
+              </servers>
+              ...
+          </settings>
+          -->
         <repository>
             <id>opensymphony</id>
             <name>OpenSymphony Maven Repository</name>
             <url>scp://maven2.opensymphony.com/opt/repository/maven2</url>
         </repository>
-      <snapshotRepository>
-         <uniqueVersion>true</uniqueVersion>
-         <id>apache.snapshots</id>
-         <name>Apache Development Snapshot Repository</name>
-         <url>scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
-      </snapshotRepository>
+        <snapshotRepository>
+            <uniqueVersion>true</uniqueVersion>
+            <id>apache.snapshots</id>
+            <name>Apache Development Snapshot Repository</name>
+            <url>scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
+        </snapshotRepository>
     </distributionManagement>
     <mailingLists>
         <mailingList>
                 </executions>
             </plugin>
             <plugin>
-              <artifactId>maven-jar-plugin</artifactId>
-              <configuration>
-                <archive>
-                  <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
-                </archive>
-              </configuration>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+                    </archive>
+                </configuration>
             </plugin>
             <plugin>
-              <groupId>org.apache.felix</groupId>
-              <artifactId>maven-bundle-plugin</artifactId>
-              <executions>
-                <execution>
-                  <id>bundle-manifest</id>
-                  <phase>process-classes</phase>
-                  <goals>
-                    <goal>manifest</goal>
-                  </goals>
-                </execution>
-              </executions>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>bundle-manifest</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>manifest</goal>
+                        </goals>
+                    </execution>
+                </executions>
             </plugin>
 
-            <plugin>
+            <!--plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-shade-plugin</artifactId>
                 <version>1.1</version>
                 <executions>
-                  <execution>
-                    <phase>package</phase>
-                    <goals>
-                      <goal>shade</goal>
-                    </goals>
-                    <configuration>
-                      <shadedArtifactId>xwork</shadedArtifactId>
-                      <artifactSet>
-                        <excludes>
-                          <exclude>junit:junit</exclude>
-                          <exclude>commons-logging:commons-logging</exclude>
-                          <exclude>opensymphony:ognl</exclude>
-                          <exclude>org.springframework:spring-core</exclude>
-                          <exclude>org.springframework:spring-aop</exclude>
-                          <exclude>org.springframework:spring-beans</exclude>
-                          <exclude>org.springframework:spring-context</exclude>
-                          <exclude>org.springframework:spring-web</exclude>
-                          <exclude>org.springframework:spring-mock</exclude>
-                          <exclude>mockobjects:mockobjects-core</exclude>
-                          <exclude>org.easymock:easymock</exclude>
-                          <exclude>aopalliance:aopalliance</exclude>
-                          <exclude>aspectwerkz:aspectwerkz-core</exclude>
-                          <exclude>cglib:cglib</exclude>
-                          <exclude>asm:asm-util</exclude>
-                          <exclude>org.testng:testng:jdk15</exclude>
-                        </excludes>
-                      </artifactSet>
-                      <relocations>
-                        <relocation>
-                          <pattern>org.objectweb.asm</pattern>
-                          <shadedPattern>org.objectweb.asm.xwork</shadedPattern>
-                        </relocation>
-                      </relocations>
-                      <transformers>
-                        <transformer implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer"/>
-                      </transformers>
-                    </configuration>
-                  </execution>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <shadedArtifactId>xwork</shadedArtifactId>
+                            <artifactSet>
+                                <excludes>
+                                    <exclude>junit:junit</exclude>
+                                    <exclude>commons-logging:commons-logging</exclude>
+                                    <exclude>opensymphony:ognl</exclude>
+                                    <exclude>org.springframework:spring-core</exclude>
+                                    <exclude>org.springframework:spring-aop</exclude>
+                                    <exclude>org.springframework:spring-aspects</exclude>
+                                    <exclude>org.springframework:spring-beans</exclude>
+                                    <exclude>org.springframework:spring-context</exclude>
+                                    <exclude>org.springframework:spring-context-support</exclude>
+                                    <exclude>org.springframework:spring-web</exclude>
+                                    <exclude>org.springframework:spring-test</exclude>
+                                    <exclude>mockobjects:mockobjects-core</exclude>
+                                    <exclude>org.easymock:easymock</exclude>
+                                    <exclude>aopalliance:aopalliance</exclude>
+                                    <exclude>aspectwerkz:aspectwerkz-core</exclude>
+                                    <exclude>aspectj:aspectjrt</exclude>
+                                    <exclude>aspectj:aspectjweaver</exclude>
+                                    <exclude>cglib:cglib</exclude>
+                                    <exclude>cglib:cglib-nodep</exclude>
+                                    <exclude>asm:asm-util</exclude>
+                                    <exclude>org.testng:testng:jdk15</exclude>
+                                </excludes>
+                            </artifactSet>
+                            <relocations>
+                                <relocation>
+                                    <pattern>org.objectweb.asm</pattern>
+                                    <shadedPattern>org.objectweb.asm.xwork</shadedPattern>
+                                </relocation>
+                            </relocations>
+                            <transformers>
+                                <transformer
+                                        implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer"/>
+                            </transformers>
+                        </configuration>
+                    </execution>
                 </executions>
-              </plugin>
+            </plugin-->
         </plugins>
         <defaultGoal>install</defaultGoal>
     </build>
             <version>1.0.4</version>
             <optional>true</optional>
         </dependency>
-       <dependency>
+        <dependency>
             <groupId>opensymphony</groupId>
             <artifactId>ognl</artifactId>
             <version>2.6.11</version>
         </dependency>
-        <dependency>
+        <!--dependency>
             <groupId>asm</groupId>
             <artifactId>asm</artifactId>
             <version>3.1</version>
             <groupId>asm</groupId>
             <artifactId>asm-commons</artifactId>
             <version>3.1</version>
-        </dependency>
+        </dependency-->
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-core</artifactId>
-            <version>2.0.7</version>
+            <version>2.5.4</version>
             <optional>true</optional>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-aop</artifactId>
-            <version>2.0.7</version>
+            <version>2.5.4</version>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-aspects</artifactId>
+            <version>2.5.4</version>
             <optional>true</optional>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-beans</artifactId>
-            <version>2.0.7</version>
+            <version>2.5.4</version>
             <optional>true</optional>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-context</artifactId>
-            <version>2.0.7</version>
+            <version>2.5.4</version>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context-support</artifactId>
+            <version>2.5.4</version>
             <optional>true</optional>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-web</artifactId>
-            <version>2.0.7</version>
+            <version>2.5.4</version>
             <optional>true</optional>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
-            <artifactId>spring-mock</artifactId>
-            <version>2.0.7</version>
-            <scope>test</scope>
+            <artifactId>spring-test</artifactId>
+            <version>2.5.4</version>
         </dependency>
+
         <dependency>
             <groupId>cglib</groupId>
             <artifactId>cglib</artifactId>
-            <version>2.1</version>
+            <version>2.1_3</version>
             <optional>true</optional>
         </dependency>
         <dependency>
             </releases>
         </pluginRepository>
     </pluginRepositories>
-	<repositories>
-		<repository>
-	      <releases>
-	        <enabled>false</enabled>
-	        <updatePolicy>always</updatePolicy>
-	        <checksumPolicy>warn</checksumPolicy>
-	      </releases>
-	      <snapshots>
-	        <enabled>true</enabled>
-	        <updatePolicy>always</updatePolicy>
-	        <checksumPolicy>fail</checksumPolicy>
-	      </snapshots>
-	      <id>apacheSnapshots</id>
-	      <name>Apache Snapshots</name>
-	      <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
-	      <layout>default</layout>
-	    </repository>
-	</repositories>
+    <repositories>
+        <repository>
+            <releases>
+                <enabled>false</enabled>
+                <updatePolicy>always</updatePolicy>
+                <checksumPolicy>warn</checksumPolicy>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+                <updatePolicy>always</updatePolicy>
+                <checksumPolicy>fail</checksumPolicy>
+            </snapshots>
+            <id>apacheSnapshots</id>
+            <name>Apache Snapshots</name>
+            <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
+            <layout>default</layout>
+        </repository>
+    </repositories>
 
 </project>

src/java/com/opensymphony/xwork2/util/finder/ClassFinder.java

 import java.util.jar.JarEntry;
 import java.util.jar.JarInputStream;
 
-import org.objectweb.asm.AnnotationVisitor;
-import org.objectweb.asm.ClassReader;
-import org.objectweb.asm.FieldVisitor;
-import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.commons.EmptyVisitor;
+//import org.objectweb.asm.AnnotationVisitor;
+//import org.objectweb.asm.ClassReader;
+//import org.objectweb.asm.FieldVisitor;
+//import org.objectweb.asm.MethodVisitor;
+//import org.objectweb.asm.commons.EmptyVisitor;
 
 import com.opensymphony.xwork2.util.logging.Logger;
 import com.opensymphony.xwork2.util.logging.LoggerFactory;
         if (!className.endsWith(".class")) {
             className = className.replace('.', '/') + ".class";
         }
-        try {
-            URL resource = classLoader.getResource(className);
-            if (resource != null) {
-                InputStream in = resource.openStream();
-                try {
-                    ClassReader classReader = new ClassReader(in);
-                    classReader.accept(new InfoBuildingVisitor(), ClassReader.SKIP_DEBUG);
-                } finally {
-                    in.close();
-                }
-            } else {
-                new Exception("Could not load " + className).printStackTrace();
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-
-    }
-
-    public class InfoBuildingVisitor extends EmptyVisitor {
-        private Info info;
-
-        public InfoBuildingVisitor() {
-        }
-
-        public InfoBuildingVisitor(Info info) {
-            this.info = info;
-        }
-
-        public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
-            if (name.endsWith("package-info")) {
-                info = new PackageInfo(javaName(name));
-            } else {
-                ClassInfo classInfo = new ClassInfo(javaName(name), javaName(superName));
-
-                for (String interfce : interfaces) {
-                    classInfo.getInterfaces().add(javaName(interfce));
-                }
-                info = classInfo;
-                classInfos.put(classInfo.getName(), classInfo);
-
-                if (extractBaseInterfaces)
-                    extractSuperInterfaces(classInfo);
-            }
-        }
-
-        private void extractSuperInterfaces(ClassInfo classInfo) {
-            String superType = classInfo.getSuperType();
-
-            if (superType != null) {
-                ClassInfo base = classInfos.get(superType);
-
-                if (base == null) {
-                    //try to load base
-                    String resource = superType.replace('.', '/') + ".class";
-                    readClassDef(resource);
-                    base = classInfos.get(superType);
-                }
-
-                if (base != null) {
-                    List<String> interfaces = classInfo.getSuperInterfaces();
-                    interfaces.addAll(base.getSuperInterfaces());
-                    interfaces.addAll(base.getInterfaces());
-                }
-            }
-        }
-
-        private String javaName(String name) {
-            return (name == null)? null:name.replace('/', '.');
-        }
-
-        public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
-            AnnotationInfo annotationInfo = new AnnotationInfo(desc);
-            info.getAnnotations().add(annotationInfo);
-            getAnnotationInfos(annotationInfo.getName()).add(info);
-            return new InfoBuildingVisitor(annotationInfo);
-        }
-
-        public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
-            ClassInfo classInfo = ((ClassInfo) info);
-            FieldInfo fieldInfo = new FieldInfo(classInfo, name, desc);
-            classInfo.getFields().add(fieldInfo);
-            return new InfoBuildingVisitor(fieldInfo);
-        }
-
-        public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
-            ClassInfo classInfo = ((ClassInfo) info);
-            MethodInfo methodInfo = new MethodInfo(classInfo, name, desc);
-            classInfo.getMethods().add(methodInfo);
-            return new InfoBuildingVisitor(methodInfo);
-        }
-
-        public AnnotationVisitor visitParameterAnnotation(int param, String desc, boolean visible) {
-            MethodInfo methodInfo = ((MethodInfo) info);
-            List<AnnotationInfo> annotationInfos = methodInfo.getParameterAnnotations(param);
-            AnnotationInfo annotationInfo = new AnnotationInfo(desc);
-            annotationInfos.add(annotationInfo);
-            return new InfoBuildingVisitor(annotationInfo);
-        }
-    }
+//        try {
+//            URL resource = classLoader.getResource(className);
+//            if (resource != null) {
+//                InputStream in = resource.openStream();
+//                try {
+//                    ClassReader classReader = new ClassReader(in);
+//                    classReader.accept(new InfoBuildingVisitor(), ClassReader.SKIP_DEBUG);
+//                } finally {
+//                    in.close();
+//                }
+//            } else {
+//                new Exception("Could not load " + className).printStackTrace();
+//            }
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//        }
+
+    }
+
+//    public class InfoBuildingVisitor extends EmptyVisitor {
+//        private Info info;
+//
+//        public InfoBuildingVisitor() {
+//        }
+//
+//        public InfoBuildingVisitor(Info info) {
+//            this.info = info;
+//        }
+//
+//        public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
+//            if (name.endsWith("package-info")) {
+//                info = new PackageInfo(javaName(name));
+//            } else {
+//                ClassInfo classInfo = new ClassInfo(javaName(name), javaName(superName));
+//
+//                for (String interfce : interfaces) {
+//                    classInfo.getInterfaces().add(javaName(interfce));
+//                }
+//                info = classInfo;
+//                classInfos.put(classInfo.getName(), classInfo);
+//
+//                if (extractBaseInterfaces)
+//                    extractSuperInterfaces(classInfo);
+//            }
+//        }
+//
+//        private void extractSuperInterfaces(ClassInfo classInfo) {
+//            String superType = classInfo.getSuperType();
+//
+//            if (superType != null) {
+//                ClassInfo base = classInfos.get(superType);
+//
+//                if (base == null) {
+//                    //try to load base
+//                    String resource = superType.replace('.', '/') + ".class";
+//                    readClassDef(resource);
+//                    base = classInfos.get(superType);
+//                }
+//
+//                if (base != null) {
+//                    List<String> interfaces = classInfo.getSuperInterfaces();
+//                    interfaces.addAll(base.getSuperInterfaces());
+//                    interfaces.addAll(base.getInterfaces());
+//                }
+//            }
+//        }
+//
+//        private String javaName(String name) {
+//            return (name == null)? null:name.replace('/', '.');
+//        }
+//
+//        public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+//            AnnotationInfo annotationInfo = new AnnotationInfo(desc);
+//            info.getAnnotations().add(annotationInfo);
+//            getAnnotationInfos(annotationInfo.getName()).add(info);
+//            return new InfoBuildingVisitor(annotationInfo);
+//        }
+//
+//        public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
+//            ClassInfo classInfo = ((ClassInfo) info);
+//            FieldInfo fieldInfo = new FieldInfo(classInfo, name, desc);
+//            classInfo.getFields().add(fieldInfo);
+//            return new InfoBuildingVisitor(fieldInfo);
+//        }
+//
+//        public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+//            ClassInfo classInfo = ((ClassInfo) info);
+//            MethodInfo methodInfo = new MethodInfo(classInfo, name, desc);
+//            classInfo.getMethods().add(methodInfo);
+//            return new InfoBuildingVisitor(methodInfo);
+//        }
+//
+//        public AnnotationVisitor visitParameterAnnotation(int param, String desc, boolean visible) {
+//            MethodInfo methodInfo = ((MethodInfo) info);
+//            List<AnnotationInfo> annotationInfos = methodInfo.getParameterAnnotations(param);
+//            AnnotationInfo annotationInfo = new AnnotationInfo(desc);
+//            annotationInfos.add(annotationInfo);
+//            return new InfoBuildingVisitor(annotationInfo);
+//        }
+//    }
 }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.