You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by gn...@apache.org on 2023/05/29 19:51:21 UTC
[maven-toolchains-plugin] branch master updated (6d750fe -> 606c27e)
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/maven-toolchains-plugin.git
from 6d750fe auto-link MTOOLCHAINS Jira
new d2cb148 Apply spotless to ITs
new 11b8221 Apply spotless on ITs and remove duplicate headers
new 606c27e Ignore reformat in blame
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../invoker.properties => .git-blame-ignore-revs | 9 +-
pom.xml | 22 ++++
src/it/missing-toolchain/pom.xml | 27 ++---
src/it/setup-custom-toolchain/pom.xml | 22 ++--
.../plugins/toolchains/its/custom/CustomMojo.java | 33 +++---
.../toolchains/its/custom/CustomToolchain.java | 10 +-
.../its/custom/CustomToolchainFactory.java | 123 ++++++++-------------
.../toolchains/its/custom/CustomToolchainImpl.java | 51 +++------
src/it/use-custom-toolchain/pom.xml | 28 ++---
.../plugins/toolchain/ToolchainConverter.java | 19 ----
.../maven/plugins/toolchain/ToolchainMojo.java | 19 ----
.../plugins/toolchain/ToolchainsRequirement.java | 19 ----
12 files changed, 143 insertions(+), 239 deletions(-)
copy src/it/setup-custom-toolchain/invoker.properties => .git-blame-ignore-revs (91%)
[maven-toolchains-plugin] 02/03: Apply spotless on ITs and remove duplicate headers
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-toolchains-plugin.git
commit 11b82214180cb03917f66478b8594e4d31cbea93
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Mon May 29 21:48:18 2023 +0200
Apply spotless on ITs and remove duplicate headers
---
src/it/missing-toolchain/pom.xml | 27 ++---
src/it/setup-custom-toolchain/pom.xml | 22 ++--
.../plugins/toolchains/its/custom/CustomMojo.java | 33 +++---
.../toolchains/its/custom/CustomToolchain.java | 10 +-
.../its/custom/CustomToolchainFactory.java | 123 ++++++++-------------
.../toolchains/its/custom/CustomToolchainImpl.java | 51 +++------
src/it/use-custom-toolchain/pom.xml | 28 ++---
.../plugins/toolchain/ToolchainConverter.java | 19 ----
.../maven/plugins/toolchain/ToolchainMojo.java | 19 ----
.../plugins/toolchain/ToolchainsRequirement.java | 19 ----
10 files changed, 115 insertions(+), 236 deletions(-)
diff --git a/src/it/missing-toolchain/pom.xml b/src/it/missing-toolchain/pom.xml
index e8ca5f9..1627ade 100644
--- a/src/it/missing-toolchain/pom.xml
+++ b/src/it/missing-toolchain/pom.xml
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -18,9 +17,7 @@ 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/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>
<groupId>org.apache.maven.plugins.toolchains.its</groupId>
@@ -29,9 +26,7 @@ under the License.
<packaging>jar</packaging>
<name>maven-toolchains-plugin IT: missing toolchain test</name>
- <description>
- Check that toolchain requirements are checked and not covered as expected
- </description>
+ <description>Check that toolchain requirements are checked and not covered as expected</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -43,23 +38,23 @@ under the License.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>@project.version@</version>
- <executions>
- <execution>
- <goals>
- <goal>toolchain</goal>
- </goals>
- </execution>
- </executions>
<configuration>
<toolchains>
- <jdk/>
+ <jdk />
<fake-type>
<attribute>value</attribute>
<other-attribute>other-value</other-attribute>
</fake-type>
- <another-fake-type/>
+ <another-fake-type />
</toolchains>
</configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>toolchain</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
diff --git a/src/it/setup-custom-toolchain/pom.xml b/src/it/setup-custom-toolchain/pom.xml
index 1d229a3..a1263e9 100644
--- a/src/it/setup-custom-toolchain/pom.xml
+++ b/src/it/setup-custom-toolchain/pom.xml
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -18,9 +17,7 @@ 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/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>
<groupId>org.apache.maven.plugins.toolchains.its</groupId>
@@ -29,10 +26,8 @@ under the License.
<packaging>maven-plugin</packaging>
<name>maven-toolchains-plugin IT: custom toolchain + plugin using it</name>
- <description>
- Demo to show how to write a custom toolchain type, a plugin using this custom toolchain,
- to later write a project that uses the toolchain and plugin.
- </description>
+ <description>Demo to show how to write a custom toolchain type, a plugin using this custom toolchain,
+ to later write a project that uses the toolchain and plugin.</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -108,7 +103,8 @@ under the License.
<goals>
<goal>helpmojo</goal>
</goals>
- <configuration><!-- TODO: remove when upgrading plugin-tools to 3.4: see MPLUGIN-238 -->
+ <configuration>
+ <!-- TODO: remove when upgrading plugin-tools to 3.4: see MPLUGIN-238 -->
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
</execution>
@@ -119,7 +115,8 @@ under the License.
<profiles>
<profile>
- <id>maven-2</id><!-- only necessary to build with Maven 2 -->
+ <id>maven-2</id>
+ <!-- only necessary to build with Maven 2 -->
<activation>
<file>
<!-- This employs that the basedir expression is only recognized by Maven 3.x (see MNG-2363) -->
@@ -138,7 +135,8 @@ under the License.
<executions>
<execution>
<id>mojo-descriptor</id>
- <goals><!-- Maven 2 does not support phase overriding: need to add an execution -->
+ <goals>
+ <!-- Maven 2 does not support phase overriding: need to add an execution -->
<goal>descriptor</goal>
</goals>
</execution>
@@ -146,6 +144,6 @@ under the License.
</plugin>
</plugins>
</build>
- </profile>
+ </profile>
</profiles>
</project>
diff --git a/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomMojo.java b/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomMojo.java
index d150bb2..c32916f 100644
--- a/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomMojo.java
+++ b/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomMojo.java
@@ -1,5 +1,3 @@
-package org.apache.maven.plugins.toolchains.its.custom;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,6 +16,7 @@ package org.apache.maven.plugins.toolchains.its.custom;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.maven.plugins.toolchains.its.custom;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
@@ -29,36 +28,32 @@ import org.apache.maven.toolchain.ToolchainManager;
/**
* A sample Mojo that uses the custom toolchain.
- *
+ *
* @author Hervé Boutemy
*/
-@Mojo( name = "tool" )
-public class CustomMojo
- extends AbstractMojo
-{
+@Mojo(name = "tool")
+public class CustomMojo extends AbstractMojo {
@Component
private ToolchainManager toolchainManager;
- @Parameter( defaultValue = "${session}", required = true, readonly = true )
+ @Parameter(defaultValue = "${session}", required = true, readonly = true)
private MavenSession session;
- public void execute()
- throws MojoExecutionException
- {
+ public void execute() throws MojoExecutionException {
// get the custom toolchain
- CustomToolchain toolchain = (CustomToolchain) toolchainManager.getToolchainFromBuildContext( "custom", session );
+ CustomToolchain toolchain = (CustomToolchain) toolchainManager.getToolchainFromBuildContext("custom", session);
- if ( toolchain == null )
- {
- throw new MojoExecutionException( "Could not find 'custom' toolchain: please check maven-toolchains-plugin configuration." );
+ if (toolchain == null) {
+ throw new MojoExecutionException(
+ "Could not find 'custom' toolchain: please check maven-toolchains-plugin configuration.");
}
- getLog().info( "Found 'custom' toolchain in build context." );
+ getLog().info("Found 'custom' toolchain in build context.");
// get a tool from the toolchain
- String path = toolchain.findTool( "tool" );
+ String path = toolchain.findTool("tool");
- getLog().info( "Found expected tool named 'tool' at following location: " + path );
+ getLog().info("Found expected tool named 'tool' at following location: " + path);
}
-}
\ No newline at end of file
+}
diff --git a/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchain.java b/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchain.java
index bf174b6..3a6a43e 100644
--- a/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchain.java
+++ b/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchain.java
@@ -1,5 +1,3 @@
-package org.apache.maven.plugins.toolchains.its.custom;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -9,7 +7,7 @@ package org.apache.maven.plugins.toolchains.its.custom;
* "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
+ * 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
@@ -18,13 +16,11 @@ package org.apache.maven.plugins.toolchains.its.custom;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.maven.plugins.toolchains.its.custom;
import org.apache.maven.toolchain.Toolchain;
/**
* @author Hervé Boutemy
*/
-public interface CustomToolchain
- extends Toolchain
-{
-}
+public interface CustomToolchain extends Toolchain {}
diff --git a/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchainFactory.java b/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchainFactory.java
index c33be0b..d7fbe66 100644
--- a/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchainFactory.java
+++ b/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchainFactory.java
@@ -1,5 +1,3 @@
-package org.apache.maven.plugins.toolchains.its.custom;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -9,7 +7,7 @@ package org.apache.maven.plugins.toolchains.its.custom;
* "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
+ * 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
@@ -18,6 +16,7 @@ package org.apache.maven.plugins.toolchains.its.custom;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.maven.plugins.toolchains.its.custom;
import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
@@ -27,8 +26,6 @@ import java.lang.reflect.Method;
import java.util.Map;
import java.util.Properties;
-import org.apache.maven.execution.MavenSession;
-import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.toolchain.MisconfiguredToolchainException;
import org.apache.maven.toolchain.RequirementMatcher;
import org.apache.maven.toolchain.RequirementMatcherFactory;
@@ -47,81 +44,67 @@ import org.codehaus.plexus.util.xml.Xpp3Dom;
*
* @author Hervé Boutemy
*/
-@Component( role = ToolchainFactory.class, hint = "custom" )
-public class CustomToolchainFactory
- implements ToolchainFactory
-{
+@Component(role = ToolchainFactory.class, hint = "custom")
+public class CustomToolchainFactory implements ToolchainFactory {
@Requirement
private Logger logger;
- public ToolchainPrivate createToolchain( ToolchainModel model )
- throws MisconfiguredToolchainException
- {
- if ( model == null )
- {
+ public ToolchainPrivate createToolchain(ToolchainModel model) throws MisconfiguredToolchainException {
+ if (model == null) {
return null;
}
- CustomToolchainImpl customToolchain = new CustomToolchainImpl( model, logger );
+ CustomToolchainImpl customToolchain = new CustomToolchainImpl(model, logger);
// populate the provides section
- Properties provides = getProvidesProperties( model );
+ Properties provides = getProvidesProperties(model);
- for ( Map.Entry<Object, Object> provide : provides.entrySet() )
- {
+ for (Map.Entry<Object, Object> provide : provides.entrySet()) {
String key = (String) provide.getKey();
String value = (String) provide.getValue();
- if ( value == null )
- {
+ if (value == null) {
throw new MisconfiguredToolchainException(
- "Provides token '" + key + "' doesn't have any value configured." );
+ "Provides token '" + key + "' doesn't have any value configured.");
}
RequirementMatcher matcher;
- if ( "version".equals( key ) )
- {
- matcher = RequirementMatcherFactory.createVersionMatcher( value );
- }
- else
- {
- matcher = RequirementMatcherFactory.createExactMatcher( value );
+ if ("version".equals(key)) {
+ matcher = RequirementMatcherFactory.createVersionMatcher(value);
+ } else {
+ matcher = RequirementMatcherFactory.createExactMatcher(value);
}
- customToolchain.addProvideToken( key, matcher );
+ customToolchain.addProvideToken(key, matcher);
}
// populate the configuration section
- Properties configuration = toProperties( (Xpp3Dom) model.getConfiguration() );
+ Properties configuration = toProperties((Xpp3Dom) model.getConfiguration());
- String toolHome = configuration.getProperty( CustomToolchainImpl.KEY_TOOLHOME );
- if ( toolHome == null )
- {
- throw new MisconfiguredToolchainException( "Custom toolchain without the "
- + CustomToolchainImpl.KEY_TOOLHOME + " configuration element." );
+ String toolHome = configuration.getProperty(CustomToolchainImpl.KEY_TOOLHOME);
+ if (toolHome == null) {
+ throw new MisconfiguredToolchainException(
+ "Custom toolchain without the " + CustomToolchainImpl.KEY_TOOLHOME + " configuration element.");
}
- toolHome = FileUtils.normalize( toolHome );
- customToolchain.setToolHome( toolHome );
+ toolHome = FileUtils.normalize(toolHome);
+ customToolchain.setToolHome(toolHome);
- if ( !new File( toolHome ).exists() )
- {
- throw new MisconfiguredToolchainException( "Non-existing tool home configuration at "
- + new File( toolHome ).getAbsolutePath() );
+ if (!new File(toolHome).exists()) {
+ throw new MisconfiguredToolchainException(
+ "Non-existing tool home configuration at " + new File(toolHome).getAbsolutePath());
}
return customToolchain;
}
- public ToolchainPrivate createDefaultToolchain()
- {
+ public ToolchainPrivate createDefaultToolchain() {
// not sure it's necessary to provide a default toolchain here.
return null;
}
- protected Logger getLogger()
- {
+ protected Logger getLogger() {
return logger;
}
@@ -129,57 +112,45 @@ public class CustomToolchainFactory
* Get <code>provides</code> properties in in a way compatible with toolchains descriptor version 1.0
* (Maven 2.0.9 to 3.2.3, where it is represented as Object/DOM) and descriptor version 1.1
* (Maven 3.2.4 and later, where it is represented as Properties).
- *
+ *
* @param model the toolchain model as read from XML
* @return the properties defined in the <code>provides</code> element
- * @see <a href="https://issues.apache.org/jira/browse/MNG-5718">MNG-5718</a>
+ * @see <a href="https://issues.apache.org/jira/browse/MNG-5718">MNG-5718</a>
*/
- protected Properties getProvidesProperties( ToolchainModel model )
- {
- Object value = getBeanProperty( model, "provides" );
+ protected Properties getProvidesProperties(ToolchainModel model) {
+ Object value = getBeanProperty(model, "provides");
- return ( value instanceof Properties ) ? (Properties) value : toProperties( (Xpp3Dom) value );
+ return (value instanceof Properties) ? (Properties) value : toProperties((Xpp3Dom) value);
}
- protected Properties toProperties( Xpp3Dom dom )
- {
+ protected Properties toProperties(Xpp3Dom dom) {
Properties props = new Properties();
Xpp3Dom[] children = dom.getChildren();
- for ( Xpp3Dom child : children )
- {
- props.put( child.getName(), child.getValue() );
+ for (Xpp3Dom child : children) {
+ props.put(child.getName(), child.getValue());
}
return props;
}
- protected Object getBeanProperty( Object obj, String property )
- {
- try
- {
- Method method = new PropertyDescriptor( property, obj.getClass() ).getReadMethod();
+ protected Object getBeanProperty(Object obj, String property) {
+ try {
+ Method method = new PropertyDescriptor(property, obj.getClass()).getReadMethod();
- return method.invoke( obj );
- }
- catch ( IntrospectionException e )
- {
- throw new RuntimeException( "Incompatible toolchain API", e );
- }
- catch ( IllegalAccessException e )
- {
- throw new RuntimeException( "Incompatible toolchain API", e );
- }
- catch ( InvocationTargetException e )
- {
+ return method.invoke(obj);
+ } catch (IntrospectionException e) {
+ throw new RuntimeException("Incompatible toolchain API", e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException("Incompatible toolchain API", e);
+ } catch (InvocationTargetException e) {
Throwable cause = e.getCause();
- if ( cause instanceof RuntimeException )
- {
+ if (cause instanceof RuntimeException) {
throw (RuntimeException) cause;
}
- throw new RuntimeException( "Incompatible toolchain API", e );
+ throw new RuntimeException("Incompatible toolchain API", e);
}
}
}
diff --git a/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchainImpl.java b/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchainImpl.java
index 990d9b6..66f8a1a 100644
--- a/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchainImpl.java
+++ b/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchainImpl.java
@@ -1,5 +1,3 @@
-package org.apache.maven.plugins.toolchains.its.custom;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -9,7 +7,7 @@ package org.apache.maven.plugins.toolchains.its.custom;
* "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
+ * 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
@@ -18,73 +16,60 @@ package org.apache.maven.plugins.toolchains.its.custom;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.maven.plugins.toolchains.its.custom;
import java.io.File;
import org.apache.maven.toolchain.DefaultToolchain;
import org.apache.maven.toolchain.model.ToolchainModel;
-import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.logging.Logger;
-import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.Os;
/**
* @author Hervé Boutemy
*/
-public class CustomToolchainImpl
- extends DefaultToolchain
- implements CustomToolchain
-{
+public class CustomToolchainImpl extends DefaultToolchain implements CustomToolchain {
private String toolHome;
public static final String KEY_TOOLHOME = "toolHome";
- public CustomToolchainImpl( ToolchainModel model, Logger logger )
- {
- super( model, "custom", logger );
+ public CustomToolchainImpl(ToolchainModel model, Logger logger) {
+ super(model, "custom", logger);
}
- public String getToolHome()
- {
+ public String getToolHome() {
return toolHome;
}
- public void setToolHome( String toolHome )
- {
+ public void setToolHome(String toolHome) {
this.toolHome = toolHome;
}
- public String toString()
- {
+ public String toString() {
return "Custom[" + getToolHome() + "]";
}
- public String findTool( String toolName )
- {
- File tool = findTool( toolName, new File( getToolHome() ) );
+ public String findTool(String toolName) {
+ File tool = findTool(toolName, new File(getToolHome()));
- if ( tool != null )
- {
+ if (tool != null) {
return tool.getAbsolutePath();
}
return null;
}
- private static File findTool( String toolName, File installFolder )
- {
- File bin = new File( installFolder, "bin" ); //NOI18N
+ private static File findTool(String toolName, File installFolder) {
+ File bin = new File(installFolder, "bin"); // NOI18N
- if ( bin.exists() )
- {
- File tool = new File( bin, toolName + ( Os.isFamily( "windows" ) ? ".exe" : "" ) ); // NOI18N
+ if (bin.exists()) {
+ File tool = new File(bin, toolName + (Os.isFamily("windows") ? ".exe" : "")); // NOI18N
- if ( tool.exists() )
- {
+ if (tool.exists()) {
return tool;
}
}
return null;
- }
-}
\ No newline at end of file
+ }
+}
diff --git a/src/it/use-custom-toolchain/pom.xml b/src/it/use-custom-toolchain/pom.xml
index 61ad85c..a3dea60 100644
--- a/src/it/use-custom-toolchain/pom.xml
+++ b/src/it/use-custom-toolchain/pom.xml
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -18,9 +17,7 @@ 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/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>
<groupId>org.apache.maven.plugins.toolchains.its</groupId>
@@ -29,9 +26,7 @@ under the License.
<packaging>jar</packaging>
<name>maven-toolchains-plugin IT: use custom toolchain test</name>
- <description>
- Check that custom toolchain can be used
- </description>
+ <description>Check that custom toolchain can be used</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -43,13 +38,6 @@ under the License.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>@project.version@</version>
- <executions>
- <execution>
- <goals>
- <goal>toolchain</goal>
- </goals>
- </execution>
- </executions>
<configuration>
<toolchains>
<custom>
@@ -57,18 +45,26 @@ under the License.
</custom>
</toolchains>
</configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>toolchain</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins.toolchains.its</groupId>
<artifactId>custom-toolchain-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
- <extensions>true</extensions><!-- to share the custom toolchain with maven-toolchains-plugin -->
+ <extensions>true</extensions>
+ <!-- to share the custom toolchain with maven-toolchains-plugin -->
<executions>
<execution>
- <phase>compile</phase>
<goals>
<goal>tool</goal>
</goals>
+ <phase>compile</phase>
</execution>
</executions>
</plugin>
diff --git a/src/main/java/org/apache/maven/plugins/toolchain/ToolchainConverter.java b/src/main/java/org/apache/maven/plugins/toolchain/ToolchainConverter.java
index 6232dc7..2ce0c9f 100644
--- a/src/main/java/org/apache/maven/plugins/toolchain/ToolchainConverter.java
+++ b/src/main/java/org/apache/maven/plugins/toolchain/ToolchainConverter.java
@@ -18,25 +18,6 @@
*/
package org.apache.maven.plugins.toolchain;
-/*
- * 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.
- */
-
import java.util.HashMap;
import java.util.Map;
diff --git a/src/main/java/org/apache/maven/plugins/toolchain/ToolchainMojo.java b/src/main/java/org/apache/maven/plugins/toolchain/ToolchainMojo.java
index d1c8a7f..7b8ec3e 100644
--- a/src/main/java/org/apache/maven/plugins/toolchain/ToolchainMojo.java
+++ b/src/main/java/org/apache/maven/plugins/toolchain/ToolchainMojo.java
@@ -18,25 +18,6 @@
*/
package org.apache.maven.plugins.toolchain;
-/*
- * 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.
- */
-
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
diff --git a/src/main/java/org/apache/maven/plugins/toolchain/ToolchainsRequirement.java b/src/main/java/org/apache/maven/plugins/toolchain/ToolchainsRequirement.java
index acb1151..2016ce1 100644
--- a/src/main/java/org/apache/maven/plugins/toolchain/ToolchainsRequirement.java
+++ b/src/main/java/org/apache/maven/plugins/toolchain/ToolchainsRequirement.java
@@ -18,25 +18,6 @@
*/
package org.apache.maven.plugins.toolchain;
-/*
- * 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.
- */
-
import java.util.Collections;
import java.util.Map;
import java.util.Set;
[maven-toolchains-plugin] 03/03: Ignore reformat in blame
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-toolchains-plugin.git
commit 606c27ea1c05a30b20caf116c11fdea291cb14a6
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Mon May 29 21:50:52 2023 +0200
Ignore reformat in blame
---
.git-blame-ignore-revs | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
new file mode 100644
index 0000000..1ea77a0
--- /dev/null
+++ b/.git-blame-ignore-revs
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+
+# Change maven code style
+11b82214180cb03917f66478b8594e4d31cbea93
[maven-toolchains-plugin] 01/03: Apply spotless to ITs
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-toolchains-plugin.git
commit d2cb148211edf81b068602061458eeb27c190bc9
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Mon May 29 21:47:55 2023 +0200
Apply spotless to ITs
---
pom.xml | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/pom.xml b/pom.xml
index b4d0d2a..7a36744 100644
--- a/pom.xml
+++ b/pom.xml
@@ -91,4 +91,26 @@ under the License.
<scope>provided</scope>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.diffplug.spotless</groupId>
+ <artifactId>spotless-maven-plugin</artifactId>
+ <configuration>
+ <pom>
+ <includes>
+ <include>pom.xml</include>
+ <include>src/it/**/pom.xml</include>
+ </includes>
+ </pom>
+ <java>
+ <includes>
+ <include>src/**/*.java</include>
+ </includes>
+ </java>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>