You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2021/10/25 20:14:54 UTC
[maven-wrapper-plugin] branch MWRAPPER-14 updated: [MWRAPPER-14]
move groupId to org.apache.maven.wrapper
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch MWRAPPER-14
in repository https://gitbox.apache.org/repos/asf/maven-wrapper-plugin.git
The following commit(s) were added to refs/heads/MWRAPPER-14 by this push:
new c34cf5c [MWRAPPER-14] move groupId to org.apache.maven.wrapper
c34cf5c is described below
commit c34cf5c0f7706f14c490eb7c6d463304f2c141f1
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Mon Oct 25 22:14:52 2021 +0200
[MWRAPPER-14] move groupId to org.apache.maven.wrapper
---
maven-wrapper-distribution/pom.xml | 4 +-
maven-wrapper-distribution/src/assembly/bin.xml | 2 +-
.../src/assembly/script/download | 4 +-
.../src/assembly/script/download.cmd | 4 +-
maven-wrapper-plugin/pom.xml | 33 ++++++++++++---
.../src/it/projects/default/invoker.properties | 18 --------
.../src/it/projects/default/verify.groovy | 2 +-
.../it/projects/excludeDebug/invoker.properties | 18 --------
.../src/it/projects/extension/invoker.properties | 3 +-
.../src/it/projects/maven3/invoker.properties | 19 ---------
.../src/it/projects/maven3/pom.xml | 29 -------------
.../src/it/projects/maven3/verify.groovy | 21 ----------
.../it/projects/mavenversion/invoker.properties | 18 --------
.../src/it/projects/type_bin/invoker.properties | 18 --------
.../src/it/projects/type_source/invoker.properties | 18 --------
.../it/projects/wrapperversion/invoker.properties | 17 --------
.../src/it/projects/wrapperversion/pom.xml | 29 -------------
.../src/it/projects/wrapperversion/test.properties | 18 --------
.../src/it/projects/wrapperversion/verify.groovy | 34 ---------------
.../apache/maven/plugins/wrapper/WrapperMojo.java | 48 ++++++++--------------
maven-wrapper/pom.xml | 2 +-
pom.xml | 1 +
22 files changed, 55 insertions(+), 305 deletions(-)
diff --git a/maven-wrapper-distribution/pom.xml b/maven-wrapper-distribution/pom.xml
index f9c49d7..3cadd8f 100644
--- a/maven-wrapper-distribution/pom.xml
+++ b/maven-wrapper-distribution/pom.xml
@@ -22,7 +22,7 @@ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.apache.maven</groupId>
+ <groupId>org.apache.maven.wrapper</groupId>
<artifactId>maven-wrapper-parent</artifactId>
<version>3.0.3-SNAPSHOT</version>
</parent>
@@ -88,7 +88,7 @@ under the License.
<dependencies>
<dependency>
- <groupId>org.apache.maven</groupId>
+ <groupId>org.apache.maven.wrapper</groupId>
<artifactId>maven-wrapper</artifactId>
<version>${project.version}</version>
</dependency>
diff --git a/maven-wrapper-distribution/src/assembly/bin.xml b/maven-wrapper-distribution/src/assembly/bin.xml
index 131d518..ab9ae45 100644
--- a/maven-wrapper-distribution/src/assembly/bin.xml
+++ b/maven-wrapper-distribution/src/assembly/bin.xml
@@ -31,7 +31,7 @@ under the License.
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<includes>
- <include>org.apache.maven:maven-wrapper:jar:*</include>
+ <include>org.apache.maven.wrapper:maven-wrapper:jar:*</include>
</includes>
<outputDirectory>.mvn/wrapper</outputDirectory>
<outputFileNameMapping>maven-wrapper.jar</outputFileNameMapping>
diff --git a/maven-wrapper-distribution/src/assembly/script/download b/maven-wrapper-distribution/src/assembly/script/download
index ed8243e..d13d81a 100755
--- a/maven-wrapper-distribution/src/assembly/script/download
+++ b/maven-wrapper-distribution/src/assembly/script/download
@@ -11,10 +11,10 @@ else
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
- jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar"
+ jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar"
if [ -n "$MVNW_REPOURL" ]; then
- jarUrl="$MVNW_REPOURL/org/apache/maven/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar"
+ jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar"
fi
if [ "$MVNW_VERBOSE" = true ]; then
diff --git a/maven-wrapper-distribution/src/assembly/script/download.cmd b/maven-wrapper-distribution/src/assembly/script/download.cmd
index 9166b9a..e4285ab 100755
--- a/maven-wrapper-distribution/src/assembly/script/download.cmd
+++ b/maven-wrapper-distribution/src/assembly/script/download.cmd
@@ -6,10 +6,10 @@ if "%MVNW_VERBOSE%" == "true" ECHO Found %LAUNCHER_JAR%
goto endWrapper
:downloadWrapper
-set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar"
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar"
if not "%MVNW_REPOURL%" == "" (
- SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar"
+ SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/${project.version}/maven-wrapper-${project.version}.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %LAUNCHER_JAR%, downloading it ...
diff --git a/maven-wrapper-plugin/pom.xml b/maven-wrapper-plugin/pom.xml
index 2a36173..7417580 100644
--- a/maven-wrapper-plugin/pom.xml
+++ b/maven-wrapper-plugin/pom.xml
@@ -23,7 +23,7 @@ under the License.
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.apache.maven</groupId>
+ <groupId>org.apache.maven.wrapper</groupId>
<artifactId>maven-wrapper-parent</artifactId>
<version>3.0.3-SNAPSHOT</version>
</parent>
@@ -81,15 +81,36 @@ under the License.
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<goals>
- <goal>wrapper</goal>
+ <goal>${project.groupId}:${project.artifactId}:${project.version}:wrapper</goal>
</goals>
<projectsDirectory>src/it/projects</projectsDirectory>
<debug>false</debug>
- <pomExcludes>
- <!-- remove once Maven 4 is released -->
- <pomExclude>wrapperversion/pom.xml</pomExclude>
- </pomExcludes>
+ <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+ <preBuildHookScript>setup</preBuildHookScript>
+ <postBuildHookScript>verify</postBuildHookScript>
+ <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+ <settingsFile>src/it/settings.xml</settingsFile>
+ <pomIncludes>
+ <pomInclude>*/pom.xml</pomInclude>
+ </pomIncludes>
+ <properties>
+ <maven.compiler.source>${invoker.maven.compiler.source}</maven.compiler.source>
+ <maven.compiler.target>${invoker.maven.compiler.target}</maven.compiler.target>
+ <!-- e.g. ensure that Java7 picks up TLSv1.2 when connecting with Central -->
+ <https.protocols>${https.protocols}</https.protocols>
+ </properties>
+ <ignoreFailures>${maven.it.failure.ignore}</ignoreFailures>
</configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>install</goal>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
diff --git a/maven-wrapper-plugin/src/it/projects/default/invoker.properties b/maven-wrapper-plugin/src/it/projects/default/invoker.properties
deleted file mode 100644
index 3125747..0000000
--- a/maven-wrapper-plugin/src/it/projects/default/invoker.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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.
-invoker.maven.version = 4+
-invoker.goals = org.apache.maven.plugins:maven-wrapper-plugin:${project.version}:wrapper
\ No newline at end of file
diff --git a/maven-wrapper-plugin/src/it/projects/default/verify.groovy b/maven-wrapper-plugin/src/it/projects/default/verify.groovy
index e721d20..47adb17 100644
--- a/maven-wrapper-plugin/src/it/projects/default/verify.groovy
+++ b/maven-wrapper-plugin/src/it/projects/default/verify.groovy
@@ -24,4 +24,4 @@ assert new File(basedir,'mvnwDebug').exists()
assert new File(basedir,'mvnwDebug.cmd').exists()
assert new File(basedir,'.mvn/wrapper/maven-wrapper.properties').exists()
assert !(new File(basedir,'.mvn/wrapper/maven-wrapper.jar').exists())
-assert new File(basedir, 'build.log').text.contains('[INFO] Unpacked org.apache.maven:apache-maven-wrapper:zip:script:')
\ No newline at end of file
+assert new File(basedir, 'build.log').text.contains('[INFO] Unpacked org.apache.maven.wrapper:maven-wrapper-distribution:zip:script:')
\ No newline at end of file
diff --git a/maven-wrapper-plugin/src/it/projects/excludeDebug/invoker.properties b/maven-wrapper-plugin/src/it/projects/excludeDebug/invoker.properties
deleted file mode 100644
index 3125747..0000000
--- a/maven-wrapper-plugin/src/it/projects/excludeDebug/invoker.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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.
-invoker.maven.version = 4+
-invoker.goals = org.apache.maven.plugins:maven-wrapper-plugin:${project.version}:wrapper
\ No newline at end of file
diff --git a/maven-wrapper-plugin/src/it/projects/extension/invoker.properties b/maven-wrapper-plugin/src/it/projects/extension/invoker.properties
index 659152d..ad41e67 100644
--- a/maven-wrapper-plugin/src/it/projects/extension/invoker.properties
+++ b/maven-wrapper-plugin/src/it/projects/extension/invoker.properties
@@ -15,4 +15,5 @@
# specific language governing permissions and limitations
# under the License.
-invoker.maven.version = 4+
+# wrapper lifecycle available because maven-wrapper-plugin is put as extension
+invoker.goals = wrapper
diff --git a/maven-wrapper-plugin/src/it/projects/maven3/invoker.properties b/maven-wrapper-plugin/src/it/projects/maven3/invoker.properties
deleted file mode 100644
index 8518b19..0000000
--- a/maven-wrapper-plugin/src/it/projects/maven3/invoker.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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.
-invoker.maven.version = 4-
-invoker.goals = org.apache.maven.plugins:maven-wrapper-plugin:${project.version}:wrapper
-invoker.buildResult = failure
\ No newline at end of file
diff --git a/maven-wrapper-plugin/src/it/projects/maven3/pom.xml b/maven-wrapper-plugin/src/it/projects/maven3/pom.xml
deleted file mode 100644
index 3a33965..0000000
--- a/maven-wrapper-plugin/src/it/projects/maven3/pom.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?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
-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/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.apache.maven.plugins.it.wrapper</groupId>
- <artifactId>maven3</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>pom</packaging>
-</project>
\ No newline at end of file
diff --git a/maven-wrapper-plugin/src/it/projects/maven3/verify.groovy b/maven-wrapper-plugin/src/it/projects/maven3/verify.groovy
deleted file mode 100644
index 55b1aeb..0000000
--- a/maven-wrapper-plugin/src/it/projects/maven3/verify.groovy
+++ /dev/null
@@ -1,21 +0,0 @@
-
-/*
- * 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.
- */
-
-assert new File(basedir, 'build.log').any { it =~ /wrapperVersion not supported for Maven 3\..+, it must be at least 4\./ }
\ No newline at end of file
diff --git a/maven-wrapper-plugin/src/it/projects/mavenversion/invoker.properties b/maven-wrapper-plugin/src/it/projects/mavenversion/invoker.properties
deleted file mode 100644
index 3125747..0000000
--- a/maven-wrapper-plugin/src/it/projects/mavenversion/invoker.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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.
-invoker.maven.version = 4+
-invoker.goals = org.apache.maven.plugins:maven-wrapper-plugin:${project.version}:wrapper
\ No newline at end of file
diff --git a/maven-wrapper-plugin/src/it/projects/type_bin/invoker.properties b/maven-wrapper-plugin/src/it/projects/type_bin/invoker.properties
deleted file mode 100644
index 3125747..0000000
--- a/maven-wrapper-plugin/src/it/projects/type_bin/invoker.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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.
-invoker.maven.version = 4+
-invoker.goals = org.apache.maven.plugins:maven-wrapper-plugin:${project.version}:wrapper
\ No newline at end of file
diff --git a/maven-wrapper-plugin/src/it/projects/type_source/invoker.properties b/maven-wrapper-plugin/src/it/projects/type_source/invoker.properties
deleted file mode 100644
index 3125747..0000000
--- a/maven-wrapper-plugin/src/it/projects/type_source/invoker.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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.
-invoker.maven.version = 4+
-invoker.goals = org.apache.maven.plugins:maven-wrapper-plugin:${project.version}:wrapper
\ No newline at end of file
diff --git a/maven-wrapper-plugin/src/it/projects/wrapperversion/invoker.properties b/maven-wrapper-plugin/src/it/projects/wrapperversion/invoker.properties
deleted file mode 100644
index 308bfd8..0000000
--- a/maven-wrapper-plugin/src/it/projects/wrapperversion/invoker.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# 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.
-invoker.goals = org.apache.maven.plugins:maven-wrapper-plugin:${project.version}:wrapper
\ No newline at end of file
diff --git a/maven-wrapper-plugin/src/it/projects/wrapperversion/pom.xml b/maven-wrapper-plugin/src/it/projects/wrapperversion/pom.xml
deleted file mode 100644
index ed54d55..0000000
--- a/maven-wrapper-plugin/src/it/projects/wrapperversion/pom.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?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
-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/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.apache.maven.plugins.it.wrapper</groupId>
- <artifactId>extension</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>pom</packaging>
-</project>
\ No newline at end of file
diff --git a/maven-wrapper-plugin/src/it/projects/wrapperversion/test.properties b/maven-wrapper-plugin/src/it/projects/wrapperversion/test.properties
deleted file mode 100644
index 6738325..0000000
--- a/maven-wrapper-plugin/src/it/projects/wrapperversion/test.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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.
-
-wrapperVersion=4.0.0
\ No newline at end of file
diff --git a/maven-wrapper-plugin/src/it/projects/wrapperversion/verify.groovy b/maven-wrapper-plugin/src/it/projects/wrapperversion/verify.groovy
deleted file mode 100644
index f972b23..0000000
--- a/maven-wrapper-plugin/src/it/projects/wrapperversion/verify.groovy
+++ /dev/null
@@ -1,34 +0,0 @@
-
-/*
- * 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.
- */
-
-assert new File(basedir,'mvnw').exists()
-assert new File(basedir,'mvnw.cmd').exists()
-assert new File(basedir,'mvnwDebug').exists()
-assert new File(basedir,'mvnwDebug.cmd').exists()
-
-def propertiesFile = new File(basedir,'.mvn/wrapper/maven-wrapper.properties')
-assert propertiesFile.exists()
-
-def props = new Properties()
-propertiesFile.withInputStream {
- props.load(it)
-}
-
-assert props.distributionUrl == 'https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip'
diff --git a/maven-wrapper-plugin/src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java b/maven-wrapper-plugin/src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java
index 2429cce..de78e6e 100644
--- a/maven-wrapper-plugin/src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java
+++ b/maven-wrapper-plugin/src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java
@@ -66,12 +66,6 @@ public class WrapperMojo extends AbstractMojo
private String mavenVersion;
/**
- * The version of the wrapper, default value is the Runtime version of Maven, should be at least 4
- */
- @Parameter( property = "wrapperVersion" )
- private String wrapperVersion;
-
- /**
* Options are:
* <dl>
* <dt>script (default)</dt>
@@ -101,9 +95,9 @@ public class WrapperMojo extends AbstractMojo
// CONSTANTS
- private static final String WRAPPER_GROUP_ID = "org.apache.maven";
+ private static final String WRAPPER_GROUP_ID = "org.apache.maven.wrapper";
- private static final String WRAPPER_ARTIFACT_ID = "apache-maven-wrapper";
+ private static final String WRAPPER_ARTIFACT_ID = "maven-wrapper-distribution";
private static final String WRAPPER_EXTENSION = "zip";
@@ -118,13 +112,8 @@ public class WrapperMojo extends AbstractMojo
@Override
public void execute() throws MojoExecutionException, MojoFailureException
{
- String wrapperVersion = getVersion( this.wrapperVersion );
- if ( wrapperVersion.startsWith( "3." ) )
- {
- throw new MojoFailureException( "wrapperVersion not supported for Maven " + wrapperVersion + ","
- + " it must be at least 4." );
- }
-
+ String wrapperVersion = getVersion( null, this.getClass(), "org.apache.maven.plugins/maven-wrapper-plugin" );
+
Artifact artifact;
try
{
@@ -134,7 +123,7 @@ public class WrapperMojo extends AbstractMojo
{
throw new MojoExecutionException( e.getMessage(), e );
}
-
+
try
{
unpack( artifact, basedir.toPath() );
@@ -144,17 +133,15 @@ public class WrapperMojo extends AbstractMojo
{
throw new MojoExecutionException( e.getMessage(), e );
}
-
- if ( mavenVersion != null )
+
+ mavenVersion = getVersion( mavenVersion, Maven.class, "org.apache.maven/maven-core" );
+ try
{
- try
- {
- replaceProperties( Files.createDirectories( basedir.toPath().resolve( ".mvn/wrapper" ) ) );
- }
- catch ( IOException e )
- {
- throw new MojoExecutionException( "can't create wrapper.properties", e );
- }
+ replaceProperties( Files.createDirectories( basedir.toPath().resolve( ".mvn/wrapper" ) ) );
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException( "can't create wrapper.properties", e );
}
}
@@ -222,21 +209,18 @@ public class WrapperMojo extends AbstractMojo
{
out.append( license );
out.append( "distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/"
- + mavenVersion
- + "/apache-maven-"
- + mavenVersion
- + "-bin.zip" );
+ + mavenVersion + "/apache-maven-" + mavenVersion + "-bin.zip" );
}
}
- private String getVersion( String defaultVersion )
+ private String getVersion( String defaultVersion, Class<?> clazz, String path )
{
String version = defaultVersion;
if ( version == null )
{
Properties props = new Properties();
try ( InputStream is =
- Maven.class.getResourceAsStream( "/META-INF/maven/org.apache.maven/maven-core/pom.properties" ) )
+ clazz.getResourceAsStream( "/META-INF/maven/" + path + "/pom.properties" ) )
{
props.load( is );
version = props.getProperty( "version" );
diff --git a/maven-wrapper/pom.xml b/maven-wrapper/pom.xml
index 90ce533..976fe32 100644
--- a/maven-wrapper/pom.xml
+++ b/maven-wrapper/pom.xml
@@ -22,7 +22,7 @@ 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">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.apache.maven</groupId>
+ <groupId>org.apache.maven.wrapper</groupId>
<artifactId>maven-wrapper-parent</artifactId>
<version>3.0.3-SNAPSHOT</version>
</parent>
diff --git a/pom.xml b/pom.xml
index 1043740..ce73810 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,6 +29,7 @@ under the License.
<relativePath />
</parent>
+ <groupId>org.apache.maven.wrapper</groupId>
<artifactId>maven-wrapper-parent</artifactId>
<version>3.0.3-SNAPSHOT</version>
<packaging>pom</packaging>