From 52111cc9250fc5876f4a6570a48bc679d099d8e2 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Tue, 16 Apr 2024 22:24:56 +0200 Subject: [PATCH] [MJAR-307] Wrong version of commons-io cause a ClassNotFound o.a.commons.io.file.attribute.FileTimes (#83) * ITs for MJAR-307 - try to reproduce * Add timestamp (#84) * Add timestamp * Add timestamp format --------- Co-authored-by: Delany * Fix a bug --------- Co-authored-by: Delany Co-authored-by: Delany --- pom.xml | 5 ++ src/it/MJAR-307/pom.xml | 47 +++++++++++++++++++ .../src/main/java/foo/project003/App.java | 32 +++++++++++++ src/it/MJAR-307/verify.groovy | 25 ++++++++++ 4 files changed, 109 insertions(+) create mode 100644 src/it/MJAR-307/pom.xml create mode 100644 src/it/MJAR-307/src/main/java/foo/project003/App.java create mode 100644 src/it/MJAR-307/verify.groovy diff --git a/pom.xml b/pom.xml index 8b55c97..bbb9847 100644 --- a/pom.xml +++ b/pom.xml @@ -88,6 +88,11 @@ pom import + + commons-io + commons-io + 2.16.1 + diff --git a/src/it/MJAR-307/pom.xml b/src/it/MJAR-307/pom.xml new file mode 100644 index 0000000..d0c36ed --- /dev/null +++ b/src/it/MJAR-307/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + org.apache.maven.plugins.jar.it + mjar-307 + jar + 1.0 + it-mjar-307 + + Wrong version of commons-io cause a ClassNotFoundException: org.apache.commons.io.file.attribute.FileTimes + + + yyyyMMdd + ${maven.build.timestamp} + + + + + + org.apache.maven.plugins + maven-jar-plugin + @project.version@ + + + + + diff --git a/src/it/MJAR-307/src/main/java/foo/project003/App.java b/src/it/MJAR-307/src/main/java/foo/project003/App.java new file mode 100644 index 0000000..3a3d166 --- /dev/null +++ b/src/it/MJAR-307/src/main/java/foo/project003/App.java @@ -0,0 +1,32 @@ +package foo.project003; + +/* + * 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. + */ + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/src/it/MJAR-307/verify.groovy b/src/it/MJAR-307/verify.groovy new file mode 100644 index 0000000..d75e626 --- /dev/null +++ b/src/it/MJAR-307/verify.groovy @@ -0,0 +1,25 @@ +import java.util.jar.JarFile + +/* + * 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. + */ + +def target = new File( basedir, "target" ); +def jarFile = new File( target, "mjar-307-1.0.jar" ); + +assert jarFile.exists()