You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2011/09/05 07:05:58 UTC
svn commit: r1165167 - in /openejb/trunk/openejb3/assembly/openejb-tomcat:
openejb-tomcat-catalina/pom.xml
openejb-tomcat-common/src/main/java/org/apache/openejb/tomcat/installer/Installer.java
Author: dblevins
Date: Mon Sep 5 05:05:57 2011
New Revision: 1165167
URL: http://svn.apache.org/viewvc?rev=1165167&view=rev
Log:
use the 'tomcat' classifier for the javaee-api jar
cleanup the install error handling a bit with regards to the creation of the annotations-api jar
Modified:
openejb/trunk/openejb3/assembly/openejb-tomcat/openejb-tomcat-catalina/pom.xml
openejb/trunk/openejb3/assembly/openejb-tomcat/openejb-tomcat-common/src/main/java/org/apache/openejb/tomcat/installer/Installer.java
Modified: openejb/trunk/openejb3/assembly/openejb-tomcat/openejb-tomcat-catalina/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/assembly/openejb-tomcat/openejb-tomcat-catalina/pom.xml?rev=1165167&r1=1165166&r2=1165167&view=diff
==============================================================================
--- openejb/trunk/openejb3/assembly/openejb-tomcat/openejb-tomcat-catalina/pom.xml (original)
+++ openejb/trunk/openejb3/assembly/openejb-tomcat/openejb-tomcat-catalina/pom.xml Mon Sep 5 05:05:57 2011
@@ -48,7 +48,7 @@
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>javaee-api</artifactId>
- <classifier>embedded</classifier>
+ <classifier>tomcat</classifier>
<version>${javaee-api.version}</version>
</dependency>
<dependency>
Modified: openejb/trunk/openejb3/assembly/openejb-tomcat/openejb-tomcat-common/src/main/java/org/apache/openejb/tomcat/installer/Installer.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/assembly/openejb-tomcat/openejb-tomcat-common/src/main/java/org/apache/openejb/tomcat/installer/Installer.java?rev=1165167&r1=1165166&r2=1165167&view=diff
==============================================================================
--- openejb/trunk/openejb3/assembly/openejb-tomcat/openejb-tomcat-common/src/main/java/org/apache/openejb/tomcat/installer/Installer.java (original)
+++ openejb/trunk/openejb3/assembly/openejb-tomcat/openejb-tomcat-common/src/main/java/org/apache/openejb/tomcat/installer/Installer.java Mon Sep 5 05:05:57 2011
@@ -109,13 +109,6 @@ public class Installer {
}
}
- public static void main(String[] args) throws IOException {
- File src = new File("/Users/dblevins/.m2/repository/org/apache/openejb/javaee-api-embedded/6.0-SNAPSHOT/javaee-api-embedded-6.0-SNAPSHOT.jar");
- File dest = new File("/tmp/annotations.jar");
-
-
- copyClasses2(src, dest, "javax/annotation/.*");
- }
private void addJavaeeInEndorsed() {
File endorsed = new File(paths.getCatalinaHomeDir(), "endorsed");
@@ -128,20 +121,15 @@ public class Installer {
}
private void copyClasses(File sourceJar, File destinationJar, String pattern) {
+ if (sourceJar == null) throw new NullPointerException("sourceJar");
+ if (destinationJar == null) throw new NullPointerException("destinationJar");
+ if (pattern == null) throw new NullPointerException("pattern");
if (destinationJar.exists()) return;
try {
- copyClasses2(sourceJar, destinationJar, pattern);
- } catch (IOException e) {
- alerts.addError(e.getMessage());
- }
- }
-
- private static File copyClasses2(File sourceFile, File destinationFile, String pattern) throws IOException {
- try {
- final ZipInputStream source = new ZipInputStream(new FileInputStream(sourceFile));
+ final ZipInputStream source = new ZipInputStream(new FileInputStream(sourceJar));
final ByteArrayOutputStream destinationBuffer = new ByteArrayOutputStream(524288);
final ZipOutputStream destination = new ZipOutputStream(destinationBuffer);
@@ -159,12 +147,10 @@ public class Installer {
close(source);
close(destination);
- writeToFile(destinationFile, destinationBuffer);
-
- } catch (Exception e) {
- e.printStackTrace();
+ writeToFile(destinationJar, destinationBuffer);
+ } catch (IOException e) {
+ alerts.addError(e.getMessage());
}
- return destinationFile;
}
public static void copy(InputStream from, OutputStream to) throws IOException {