[Git][java-team/tomcat-jakartaee-migration][upstream] New upstream version 0.1.0
Emmanuel Bourg
gitlab at salsa.debian.org
Wed Dec 30 10:04:15 GMT 2020
Emmanuel Bourg pushed to branch upstream at Debian Java Maintainers / tomcat-jakartaee-migration
Commits:
20206719 by Emmanuel Bourg at 2020-12-10T23:11:16+01:00
New upstream version 0.1.0
- - - - -
6 changed files:
- pom.xml
- src/assembly/bin.xml
- + src/assembly/src.xml
- src/main/java/org/apache/tomcat/jakartaee/Migration.java
- src/main/scripts/migrate.sh
- src/test/java/org/apache/tomcat/jakartaee/MigrationTest.java
Changes:
=====================================
pom.xml
=====================================
@@ -15,8 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<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">
+<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>
<parent>
@@ -27,7 +26,7 @@
<groupId>org.apache.tomcat</groupId>
<artifactId>jakartaee-migration</artifactId>
- <version>0.0.2</version>
+ <version>0.1.0</version>
<description>
This tool is a work in progress.
@@ -63,13 +62,15 @@
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
+ <!-- Override settings from parent POM -->
+ <sourceReleaseAssemblyDescriptor>src</sourceReleaseAssemblyDescriptor>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.bcel</groupId>
<artifactId>bcel</artifactId>
- <version>6.4.1</version>
+ <version>6.5.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
@@ -87,11 +88,18 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.13</version>
+ <version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
+ <scm>
+ <connection>scm:git:https://gitbox.apache.org/repos/asf/tomcat-jakartaee-migration.git</connection>
+ <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/tomcat-jakartaee-migration.git</developerConnection>
+ <url>https://gitbox.apache.org/repos/asf?p=tomcat-jakartaee-migration.git</url>
+ <tag>0.1.0</tag>
+ </scm>
+
<build>
<resources>
<resource>
@@ -107,7 +115,7 @@
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
<configuration>
- <check/>
+ <check />
<formats>
<format>html</format>
<format>xml</format>
@@ -130,10 +138,10 @@
</goals>
<configuration>
<target>
- <jar destfile="target/test-classes/cgi-api.jar" basedir="target/test-classes" includes="**/CommonGatewayInterface*"/>
+ <jar destfile="target/test-classes/cgi-api.jar" basedir="target/test-classes" includes="**/CommonGatewayInterface*" />
<jar destfile="target/test-classes/hellocgi.jar" basedir="target/test-classes" includes="**/HelloCGI*">
<manifest>
- <attribute name="Implementation-Version" value="1.2.3"/>
+ <attribute name="Implementation-Version" value="1.2.3" />
</manifest>
</jar>
@@ -146,16 +154,16 @@
-->
<parallel>
<sequential>
- <copy file="target/test-classes/hellocgi.jar" tofile="target/test-classes/hellocgi-signed-rsa.jar"/>
- <signjar jar="target/test-classes/hellocgi-signed-rsa.jar" keystore="src/test/resources/keystore.p12" storepass="apache" alias="rsa"/>
+ <copy file="target/test-classes/hellocgi.jar" tofile="target/test-classes/hellocgi-signed-rsa.jar" />
+ <signjar jar="target/test-classes/hellocgi-signed-rsa.jar" keystore="src/test/resources/keystore.p12" storepass="apache" alias="rsa" />
</sequential>
<sequential>
- <copy file="target/test-classes/hellocgi.jar" tofile="target/test-classes/hellocgi-signed-dsa.jar"/>
- <signjar jar="target/test-classes/hellocgi-signed-dsa.jar" keystore="src/test/resources/keystore.p12" storepass="apache" alias="dsa"/>
+ <copy file="target/test-classes/hellocgi.jar" tofile="target/test-classes/hellocgi-signed-dsa.jar" />
+ <signjar jar="target/test-classes/hellocgi-signed-dsa.jar" keystore="src/test/resources/keystore.p12" storepass="apache" alias="dsa" />
</sequential>
<sequential>
- <copy file="target/test-classes/hellocgi.jar" tofile="target/test-classes/hellocgi-signed-ec.jar"/>
- <signjar jar="target/test-classes/hellocgi-signed-ec.jar" keystore="src/test/resources/keystore.p12" storepass="apache" alias="ec"/>
+ <copy file="target/test-classes/hellocgi.jar" tofile="target/test-classes/hellocgi-signed-ec.jar" />
+ <signjar jar="target/test-classes/hellocgi-signed-ec.jar" keystore="src/test/resources/keystore.p12" storepass="apache" alias="ec" />
</sequential>
</parallel>
</target>
@@ -180,17 +188,53 @@
</archive>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>3.2.0</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<!-- NOTE: We don't need a groupId specification because the group is
org.apache.maven.plugins ...which is assumed by default.
-->
<artifactId>maven-assembly-plugin</artifactId>
<version>3.2.0</version>
- <configuration>
- <descriptors>
- <descriptor>src/assembly/bin.xml</descriptor>
- </descriptors>
- </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/bin.xml</descriptor>
+ <descriptor>src/assembly/src.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
=====================================
src/assembly/bin.xml
=====================================
@@ -1,3 +1,19 @@
+<!--
+ 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.
+-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
@@ -8,8 +24,6 @@
</formats>
<fileSets>
<fileSet>
- <directory>${project.basedir}</directory>
- <outputDirectory></outputDirectory>
<includes>
<include>README*</include>
<include>LICENSE*</include>
=====================================
src/assembly/src.xml
=====================================
@@ -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.
+-->
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+ <id>src</id>
+ <formats>
+ <format>tar.gz</format>
+ <format>zip</format>
+ </formats>
+ <fileSets>
+ <fileSet>
+ <includes>
+ <include>LICENSE*</include>
+ <include>NOTICE*</include>
+ <include>pom.xml</include>
+ <include>README*</include>
+ <include>mvnw*</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>src</directory>
+ </fileSet>
+ </fileSets>
+</assembly>
=====================================
src/main/java/org/apache/tomcat/jakartaee/Migration.java
=====================================
@@ -99,7 +99,7 @@ public class Migration {
boolean result = true;
long t1 = System.nanoTime();
if (source.isDirectory()) {
- if (destination.mkdirs()) {
+ if ((destination.exists() && destination.isDirectory()) || destination.mkdirs()) {
result = result && migrateDirectory(source, destination);
} else {
logger.log(Level.WARNING, sm.getString("migration.mkdirError", destination.getAbsolutePath()));
@@ -129,7 +129,7 @@ public class Migration {
File srcFile = new File(src, file);
File destFile = new File(dest, file);
if (srcFile.isDirectory()) {
- if (destFile.mkdir()) {
+ if ((destFile.exists() && destFile.isDirectory()) || destFile.mkdir()) {
result = result && migrateDirectory(srcFile, destFile);
} else {
logger.log(Level.WARNING, sm.getString("migration.mkdirError", destFile.getAbsolutePath()));
=====================================
src/main/scripts/migrate.sh
=====================================
=====================================
src/test/java/org/apache/tomcat/jakartaee/MigrationTest.java
=====================================
@@ -157,11 +157,12 @@ public class MigrationTest {
assertEquals("jakarta.servlet.CommonGatewayInterface", cls.getSuperclass().getName());
// check the modification of the Implementation-Version manifest attribute
- JarFile jar = new JarFile(jarFile);
- String implementationVersion = jar.getManifest().getMainAttributes().getValue("Implementation-Version");
- assertNotNull("Missing Implementation-Version manifest attribute", implementationVersion);
- assertNotEquals("Implementation-Version manifest attribute not changed", "1.2.3", implementationVersion);
- assertTrue("Implementation-Version manifest attribute doesn't match the expected pattern", implementationVersion.matches("1\\.2\\.3-migrated-[\\d\\.]+.*"));
+ try (JarFile jar = new JarFile(jarFile)) {
+ String implementationVersion = jar.getManifest().getMainAttributes().getValue("Implementation-Version");
+ assertNotNull("Missing Implementation-Version manifest attribute", implementationVersion);
+ assertNotEquals("Implementation-Version manifest attribute not changed", "1.2.3", implementationVersion);
+ assertTrue("Implementation-Version manifest attribute doesn't match the expected pattern", implementationVersion.matches("1\\.2\\.3-migrated-[\\d\\.]+.*"));
+ }
}
@Test
@@ -187,9 +188,10 @@ public class MigrationTest {
migration.setDestination(jarFile);
migration.execute();
- JarFile jar = new JarFile(jarFile);
- assertNull("Digest not removed from the manifest", jar.getManifest().getAttributes("org/apache/tomcat/jakartaee/HelloCGI.class"));
- assertNull("Signature key not removed", jar.getEntry("META-INF/" + algorithm.toUpperCase() + "." + algorithm.toUpperCase()));
- assertNull("Signed manifest not removed", jar.getEntry("META-INF/" + algorithm.toUpperCase() + ".SF"));
+ try (JarFile jar = new JarFile(jarFile)) {
+ assertNull("Digest not removed from the manifest", jar.getManifest().getAttributes("org/apache/tomcat/jakartaee/HelloCGI.class"));
+ assertNull("Signature key not removed", jar.getEntry("META-INF/" + algorithm.toUpperCase() + "." + algorithm.toUpperCase()));
+ assertNull("Signed manifest not removed", jar.getEntry("META-INF/" + algorithm.toUpperCase() + ".SF"));
+ }
}
}
View it on GitLab: https://salsa.debian.org/java-team/tomcat-jakartaee-migration/-/commit/20206719cb203cebce802479e311708eadccc996
--
View it on GitLab: https://salsa.debian.org/java-team/tomcat-jakartaee-migration/-/commit/20206719cb203cebce802479e311708eadccc996
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20201230/85fc26f8/attachment.html>
More information about the pkg-java-commits
mailing list