Skip to content

Commit f7a6f22

Browse files
authored
[MRESOURCES-297] Update to parent POM 39, reformat (#55)
Slight change introduced in src/it/includeEmptyDirs that used ".gitattributes" as placeholder, but that file is not excluded anymore with latest plexus-utils. Sources and javadoc adapted, IT fixed to use "._placeholder" instead. --- https://issues.apache.org/jira/browse/MRESOURCES-297
1 parent 22d64ca commit f7a6f22

19 files changed

+819
-1094
lines changed

pom.xml

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<?xml version='1.0' encoding='UTF-8'?>
2-
1+
<?xml version="1.0" encoding="UTF-8"?>
32
<!--
43
Licensed to the Apache Software Foundation (ASF) under one
54
or more contributor license agreements. See the NOTICE file
@@ -18,40 +17,43 @@ KIND, either express or implied. See the License for the
1817
specific language governing permissions and limitations
1918
under the License.
2019
-->
21-
2220
<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">
2321
<modelVersion>4.0.0</modelVersion>
2422

2523
<parent>
26-
<artifactId>maven-plugins</artifactId>
2724
<groupId>org.apache.maven.plugins</groupId>
28-
<version>36</version>
25+
<artifactId>maven-plugins</artifactId>
26+
<version>39</version>
2927
</parent>
3028

3129
<artifactId>maven-resources-plugin</artifactId>
3230
<version>3.3.1-SNAPSHOT</version>
3331
<packaging>maven-plugin</packaging>
3432

3533
<name>Apache Maven Resources Plugin</name>
36-
<description>
37-
The Resources Plugin handles the copying of project resources to the output
34+
<description>The Resources Plugin handles the copying of project resources to the output
3835
directory. There are two different kinds of resources: main resources and test resources. The
3936
difference is that the main resources are the resources associated with the main
4037
source code while the test resources are associated with the test source code.
4138
Thus, this allows the separation of resources for the main source code and its
42-
unit tests.
43-
</description>
39+
unit tests.</description>
4440
<inceptionYear>2001</inceptionYear>
4541

42+
<contributors>
43+
<contributor>
44+
<name>Graham Leggett</name>
45+
</contributor>
46+
</contributors>
47+
4648
<prerequisites>
4749
<maven>${mavenVersion}</maven>
4850
</prerequisites>
4951

5052
<scm>
5153
<connection>scm:git:https://gitbox.apache.org/repos/asf/maven-resources-plugin.git</connection>
5254
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-resources-plugin.git</developerConnection>
53-
<url>https://github.com/apache/maven-resources-plugin/tree/${project.scm.tag}</url>
5455
<tag>HEAD</tag>
56+
<url>https://github.com/apache/maven-resources-plugin/tree/${project.scm.tag}</url>
5557
</scm>
5658
<issueManagement>
5759
<system>JIRA</system>
@@ -75,12 +77,6 @@ under the License.
7577
<project.build.outputTimestamp>2022-07-23T17:49:18Z</project.build.outputTimestamp>
7678
</properties>
7779

78-
<contributors>
79-
<contributor>
80-
<name>Graham Leggett</name>
81-
</contributor>
82-
</contributors>
83-
8480
<dependencies>
8581
<dependency>
8682
<groupId>org.apache.maven</groupId>
@@ -123,6 +119,11 @@ under the License.
123119
<version>0.3.5</version>
124120
<scope>provided</scope>
125121
</dependency>
122+
<dependency>
123+
<groupId>org.codehaus.plexus</groupId>
124+
<artifactId>plexus-utils</artifactId>
125+
<version>3.5.1</version>
126+
</dependency>
126127
<dependency>
127128
<groupId>org.apache.maven.shared</groupId>
128129
<artifactId>maven-filtering</artifactId>
@@ -160,21 +161,29 @@ under the License.
160161
<version>4.13.2</version>
161162
<scope>test</scope>
162163
</dependency>
163-
<dependency>
164-
<groupId>org.codehaus.plexus</groupId>
165-
<artifactId>plexus-utils</artifactId>
166-
<version>3.5.1</version>
167-
<scope>test</scope>
168-
</dependency>
169164
<dependency>
170165
<groupId>org.apache.maven.resolver</groupId>
171166
<artifactId>maven-resolver-api</artifactId>
172167
<version>1.6.3</version>
173168
<scope>test</scope>
174169
</dependency>
175-
176170
</dependencies>
177171

172+
<build>
173+
<plugins>
174+
<plugin>
175+
<groupId>org.apache.rat</groupId>
176+
<artifactId>apache-rat-plugin</artifactId>
177+
<configuration>
178+
<excludes combine.children="append">
179+
<!-- ITs and IT resources -->
180+
<exclude>src/it/**</exclude>
181+
</excludes>
182+
</configuration>
183+
</plugin>
184+
</plugins>
185+
</build>
186+
178187
<profiles>
179188
<profile>
180189
<id>run-its</id>

src/it/includeEmptyDirs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Note: this file uses ".git" named files as placeholders, that are part of "default excludes" in plexus-utils.
2+
Before, this IT used ".gitattributes" file, but it was removed from set of default excludes by this
3+
commit: https://github.com/codehaus-plexus/plexus-utils/commit/e8a8433894eae9e8f82cbba4b903508362e9322a
Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
package org.apache.maven.plugins.resources;
2-
31
/*
42
* Licensed to the Apache Software Foundation (ASF) under one
53
* or more contributor license agreements. See the NOTICE file
@@ -18,73 +16,64 @@
1816
* specific language governing permissions and limitations
1917
* under the License.
2018
*/
19+
package org.apache.maven.plugins.resources;
20+
21+
import java.io.File;
22+
import java.util.List;
2123

2224
import org.apache.maven.model.Resource;
2325
import org.apache.maven.plugins.annotations.Mojo;
2426
import org.apache.maven.plugins.annotations.Parameter;
2527

26-
import java.io.File;
27-
import java.util.List;
28-
2928
/**
3029
* Copy resources of the configured plugin attribute resources
31-
*
30+
*
3231
* @author Olivier Lamy
3332
* @since 2.3
3433
*/
35-
@Mojo( name = "copy-resources", threadSafe = true )
36-
public class CopyResourcesMojo
37-
extends ResourcesMojo
38-
{
39-
34+
@Mojo(name = "copy-resources", threadSafe = true)
35+
public class CopyResourcesMojo extends ResourcesMojo {
36+
4037
/**
4138
* The output directory into which to copy the resources.
4239
*/
43-
@Parameter( required = true )
40+
@Parameter(required = true)
4441
private File outputDirectory;
4542

4643
/**
4744
* The list of resources we want to transfer. See the Maven Model for a
4845
* description of how to code the resources element.
4946
*/
50-
@Parameter( required = true )
47+
@Parameter(required = true)
5148
private List<Resource> resources;
5249

53-
5450
/** {@inheritDoc} */
55-
public File getOutputDirectory()
56-
{
51+
public File getOutputDirectory() {
5752
return outputDirectory;
5853
}
5954

6055
/** {@inheritDoc} */
61-
public void setOutputDirectory( File outputDirectory )
62-
{
56+
public void setOutputDirectory(File outputDirectory) {
6357
this.outputDirectory = outputDirectory;
6458
}
6559

6660
/** {@inheritDoc} */
67-
public List<Resource> getResources()
68-
{
61+
public List<Resource> getResources() {
6962
return resources;
7063
}
7164

7265
/** {@inheritDoc} */
73-
public void setResources( List<Resource> resources )
74-
{
66+
public void setResources(List<Resource> resources) {
7567
this.resources = resources;
7668
}
7769

7870
/** {@inheritDoc} */
79-
public List<String> getFilters()
80-
{
71+
public List<String> getFilters() {
8172
return filters;
8273
}
8374

8475
/** {@inheritDoc} */
85-
public void setFilters( List<String> filters )
86-
{
76+
public void setFilters(List<String> filters) {
8777
this.filters = filters;
88-
}
89-
78+
}
9079
}
Lines changed: 22 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
package org.apache.maven.plugins.resources;
2-
31
/*
42
* Licensed to the Apache Software Foundation (ASF) under one
53
* or more contributor license agreements. See the NOTICE file
@@ -9,7 +7,7 @@
97
* "License"); you may not use this file except in compliance
108
* with the License. You may obtain a copy of the License at
119
*
12-
* http://www.apache.org/licenses/LICENSE-2.0
10+
* http://www.apache.org/licenses/LICENSE-2.0
1311
*
1412
* Unless required by applicable law or agreed to in writing,
1513
* software distributed under the License is distributed on an
@@ -18,6 +16,7 @@
1816
* specific language governing permissions and limitations
1917
* under the License.
2018
*/
19+
package org.apache.maven.plugins.resources;
2120

2221
import java.text.SimpleDateFormat;
2322
import java.util.Date;
@@ -28,8 +27,7 @@
2827
/**
2928
* This class is duplicated from maven-model-builder from maven core. (See MRESOURCES-99).
3029
*/
31-
public class MavenBuildTimestamp
32-
{
30+
public class MavenBuildTimestamp {
3331
/**
3432
* ISO 8601-compliant timestamp for machine readability
3533
*/
@@ -43,71 +41,59 @@ public class MavenBuildTimestamp
4341
/**
4442
* The default time zone {@code Etc/UTC}.
4543
*/
46-
public static final TimeZone DEFAULT_BUILD_TIME_ZONE = TimeZone.getTimeZone( "Etc/UTC" );
44+
public static final TimeZone DEFAULT_BUILD_TIME_ZONE = TimeZone.getTimeZone("Etc/UTC");
4745

4846
private String formattedTimestamp;
4947

5048
/**
5149
* Create an instance.
5250
*/
53-
public MavenBuildTimestamp()
54-
{
55-
this( new Date() );
51+
public MavenBuildTimestamp() {
52+
this(new Date());
5653
}
5754

5855
/**
5956
* @param time The time to use.
6057
*/
61-
public MavenBuildTimestamp( Date time )
62-
{
63-
this( time, DEFAULT_BUILD_TIMESTAMP_FORMAT );
58+
public MavenBuildTimestamp(Date time) {
59+
this(time, DEFAULT_BUILD_TIMESTAMP_FORMAT);
6460
}
6561

6662
/**
6763
* @param time The time to use.
6864
* @param properties the properties which can be define. can be {@code null}
6965
*/
70-
public MavenBuildTimestamp( Date time, Properties properties )
71-
{
72-
this( time, properties != null ? properties.getProperty( BUILD_TIMESTAMP_FORMAT_PROPERTY ) : null );
66+
public MavenBuildTimestamp(Date time, Properties properties) {
67+
this(time, properties != null ? properties.getProperty(BUILD_TIMESTAMP_FORMAT_PROPERTY) : null);
7368
}
7469

7570
/**
7671
* @param time The time to use.
7772
* @param timestampFormat The format for {@link SimpleDateFormat}.
7873
*/
79-
public MavenBuildTimestamp( Date time, String timestampFormat )
80-
{
74+
public MavenBuildTimestamp(Date time, String timestampFormat) {
8175
SimpleDateFormat dateFormat;
8276

83-
if ( timestampFormat == null )
84-
{
85-
dateFormat = new SimpleDateFormat( DEFAULT_BUILD_TIMESTAMP_FORMAT );
86-
}
87-
else
88-
{
89-
dateFormat = new SimpleDateFormat( timestampFormat );
77+
if (timestampFormat == null) {
78+
dateFormat = new SimpleDateFormat(DEFAULT_BUILD_TIMESTAMP_FORMAT);
79+
} else {
80+
dateFormat = new SimpleDateFormat(timestampFormat);
9081
}
9182

92-
dateFormat.setCalendar( new GregorianCalendar() );
93-
dateFormat.setTimeZone( DEFAULT_BUILD_TIME_ZONE );
83+
dateFormat.setCalendar(new GregorianCalendar());
84+
dateFormat.setTimeZone(DEFAULT_BUILD_TIME_ZONE);
9485

95-
if ( time == null )
96-
{
97-
formattedTimestamp = dateFormat.format( new Date() );
98-
}
99-
else
100-
{
101-
formattedTimestamp = dateFormat.format( time );
86+
if (time == null) {
87+
formattedTimestamp = dateFormat.format(new Date());
88+
} else {
89+
formattedTimestamp = dateFormat.format(time);
10290
}
103-
10491
}
10592

10693
/**
10794
* @return The formatted time stamp.
10895
*/
109-
public String formattedTimestamp()
110-
{
96+
public String formattedTimestamp() {
11197
return formattedTimestamp;
11298
}
11399
}

src/main/java/org/apache/maven/plugins/resources/Resource.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
package org.apache.maven.plugins.resources;
2-
31
/*
42
* Licensed to the Apache Software Foundation (ASF) under one
53
* or more contributor license agreements. See the NOTICE file
@@ -18,15 +16,14 @@
1816
* specific language governing permissions and limitations
1917
* under the License.
2018
*/
19+
package org.apache.maven.plugins.resources;
2120

2221
/**
2322
* @author Olivier Lamy
2423
* @since 2.3
2524
*
2625
*/
27-
public class Resource
28-
extends org.apache.maven.model.Resource
29-
{
26+
public class Resource extends org.apache.maven.model.Resource {
3027
// nothing to do here just a class prevent users adding an implementation attribute
3128
// in the mojo configuration
3229
}

0 commit comments

Comments
 (0)