Skip to content

Commit

Permalink
[MJAR-307] Wrong version of commons-io cause a ClassNotFound o.a.comm…
Browse files Browse the repository at this point in the history
…ons.io.file.attribute.FileTimes (#83)

* ITs for MJAR-307 - try to reproduce

* Add timestamp (#84)

* Add timestamp

* Add timestamp format

---------

Co-authored-by: Delany <[email protected]>

* Fix a bug

---------

Co-authored-by: Delany <[email protected]>
Co-authored-by: Delany <[email protected]>
  • Loading branch information
3 people authored Apr 16, 2024
1 parent 902d4c5 commit 52111cc
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.16.1</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
47 changes: 47 additions & 0 deletions src/it/MJAR-307/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!--
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.
-->

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.apache.maven.plugins.jar.it</groupId>
<artifactId>mjar-307</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<name>it-mjar-307</name>

<description>Wrong version of commons-io cause a ClassNotFoundException: org.apache.commons.io.file.attribute.FileTimes</description>

<properties>
<maven.build.timestamp.format>yyyyMMdd</maven.build.timestamp.format>
<project.build.outputTimestamp>${maven.build.timestamp}</project.build.outputTimestamp>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>@project.version@</version>
</plugin>
</plugins>
</build>

</project>
32 changes: 32 additions & 0 deletions src/it/MJAR-307/src/main/java/foo/project003/App.java
Original file line number Diff line number Diff line change
@@ -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!" );
}
}
25 changes: 25 additions & 0 deletions src/it/MJAR-307/verify.groovy
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 52111cc

Please sign in to comment.