You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2017/01/22 15:11:16 UTC
svn commit: r1779824 - in /maven/plugins/trunk/maven-invoker-plugin: ./
src/it/invocation-multiple/ src/it/invocation-multiple/src/it/project/
src/it/settings-merge/ src/it/settings-merge_jdk9+/
src/it/settings-merge_jdk9+/src/ src/it/settings-merge_jd...
Author: rfscholte
Date: Sun Jan 22 15:11:16 2017
New Revision: 1779824
URL: http://svn.apache.org/viewvc?rev=1779824&view=rev
Log:
[MINVOKER-216] Prepare for Java9 (requires Groovy upgrade)
Added:
maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/
maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/invoker.properties
maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/pom.xml
maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/src/
maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/src/it/
maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/src/it/project/
maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/src/it/project/pom.xml
maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/src/it/project/postbuild.groovy
maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/src/it/settings.xml
Modified:
maven/plugins/trunk/maven-invoker-plugin/pom.xml
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-multiple/pom.xml
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-multiple/src/it/project/pom.xml
maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge/invoker.properties
Modified: maven/plugins/trunk/maven-invoker-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/pom.xml?rev=1779824&r1=1779823&r2=1779824&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-invoker-plugin/pom.xml Sun Jan 22 15:11:16 2017
@@ -68,10 +68,7 @@ under the License.
<beanshell-version>2.0b4</beanshell-version>
<groovy-groupId>org.codehaus.groovy</groovy-groupId>
<groovy-artifactId>groovy-all</groovy-artifactId>
- <groovy-version>2.0.1</groovy-version>
- <javaVersion>6</javaVersion>
- <maven.compiler.source>1.${javaVersion}</maven.compiler.source>
- <maven.compiler.target>1.${javaVersion}</maven.compiler.target>
+ <groovy-version>2.2.2</groovy-version> <!-- latest 1.6 compatible -->
</properties>
<dependencies>
@@ -126,6 +123,13 @@ under the License.
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-script-interpreter</artifactId>
<version>1.1</version>
+ <exclusions>
+ <!-- there's already a direct dependency to groovy-all -->
+ <exclusion>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
@@ -162,18 +166,15 @@ under the License.
<groupId>${beanshell-groupId}</groupId>
<artifactId>${beanshell-artifactId}</artifactId>
<version>${beanshell-version}</version>
+ <scope>runtime</scope>
</dependency>
<dependency>
<groupId>${groovy-groupId}</groupId>
<artifactId>${groovy-artifactId}</artifactId>
<version>${groovy-version}</version>
- <exclusions>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- </exclusions>
+ <scope>runtime</scope>
</dependency>
+
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
@@ -301,6 +302,10 @@ under the License.
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<settingsFile>src/it/settings.xml</settingsFile>
<mavenOpts>-Djava.io.tmpdir=${project.build.directory}</mavenOpts>
+ <properties>
+ <maven.compiler.source>${maven.compiler.source}</maven.compiler.source>
+ <maven.compiler.target>${maven.compiler.target}</maven.compiler.target>
+ </properties>
<goals>
<goal>clean</goal>
<goal>initialize</goal>
@@ -348,5 +353,47 @@ under the License.
</pluginManagement>
</build>
</profile>
+ <profile>
+ <activation>
+ <jdk>[1.7,)</jdk>
+ </activation>
+ <properties>
+ <groovy-version>2.4.8</groovy-version>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <!-- compile time should be 1.6 compatible -->
+ <!-- groovy-all 2.3.0+ has 2 java7 classes -->
+ <execution>
+ <id>enforce-bytecode-version</id>
+ <configuration>
+ <rules>
+ <enforceBytecodeVersion>
+ <ignoredScopes>
+ <ignoredScope>runtime</ignoredScope>
+ </ignoredScopes>
+ </enforceBytecodeVersion>
+ </rules>
+ </configuration>
+ </execution>
+ <execution>
+ <id>enforce-bytecode-version-runtime</id>
+ <configuration>
+ <rules>
+ <enforceBytecodeVersion>
+ <maxJdkVersion>1.7</maxJdkVersion>
+ </enforceBytecodeVersion>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
Modified: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-multiple/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-multiple/pom.xml?rev=1779824&r1=1779823&r2=1779824&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-multiple/pom.xml (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-multiple/pom.xml Sun Jan 22 15:11:16 2017
@@ -52,6 +52,10 @@ under the License.
<filterProperties>
<invoker.repo.local>${invoker.repo.local}</invoker.repo.local>
</filterProperties>
+ <properties>
+ <maven.compiler.source>${maven.compiler.source}</maven.compiler.source>
+ <maven.compiler.target>${maven.compiler.target}</maven.compiler.target>
+ </properties>
</configuration>
<executions>
<execution>
Modified: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-multiple/src/it/project/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-multiple/src/it/project/pom.xml?rev=1779824&r1=1779823&r2=1779824&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-multiple/src/it/project/pom.xml (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-multiple/src/it/project/pom.xml Sun Jan 22 15:11:16 2017
@@ -48,8 +48,8 @@ under the License.
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
- <source>1.4</source>
- <target>1.4</target>
+ <source>${maven.compiler.source}</source>
+ <target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
Modified: maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge/invoker.properties?rev=1779824&r1=1779823&r2=1779824&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge/invoker.properties (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge/invoker.properties Sun Jan 22 15:11:16 2017
@@ -17,3 +17,4 @@
# See https://issues.apache.org/jira/browse/MNG-5224
invoker.maven.version = 3.0-,3.0.4+
+invoker.java.version = 9-
\ No newline at end of file
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9%2B/invoker.properties?rev=1779824&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/invoker.properties (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/invoker.properties Sun Jan 22 15:11:16 2017
@@ -0,0 +1,19 @@
+# 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.
+
+# See https://issues.apache.org/jira/browse/MNG-5224
+invoker.maven.version = 3.0-,3.0.4+
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9%2B/pom.xml?rev=1779824&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/pom.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/pom.xml Sun Jan 22 15:11:16 2017
@@ -0,0 +1,61 @@
+<?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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.invoker</groupId>
+ <artifactId>settings-merge</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <description>Test to check that the settings.xml from the calling process is merged with the
+ one specified for m-invoker-p.</description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+ <cloneClean>true</cloneClean>
+ <settingsFile>src/it/settings.xml</settingsFile>
+ <mergeUserSettings>true</mergeUserSettings>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/src/it/project/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9%2B/src/it/project/pom.xml?rev=1779824&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/src/it/project/pom.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/src/it/project/pom.xml Sun Jan 22 15:11:16 2017
@@ -0,0 +1,84 @@
+<?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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>test</groupId>
+ <artifactId>project</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0.1</version>
+ <executions>
+ <execution>
+ <id>verify-properties</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireProperty>
+ <property>it.settings-merge.1</property>
+ <message>Property not present - settings.xml from calling process not merged!</message>
+ <regex>(exists)$</regex>
+ </requireProperty>
+ <requireProperty>
+ <property>it.settings-merge.2</property>
+ <message>Property not present - specified settings.xml not merged!</message>
+ <regex>(exists)$</regex>
+ </requireProperty>
+ </rules>
+ <fail>true</fail>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-help-plugin</artifactId>
+ <version>2.2</version>
+ <executions>
+ <execution>
+ <id>effective-settings</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>effective-settings</goal>
+ </goals>
+ <configuration>
+ <output>effective-settings.xml</output>
+ <showPasswords>true</showPasswords>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/src/it/project/postbuild.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9%2B/src/it/project/postbuild.groovy?rev=1779824&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/src/it/project/postbuild.groovy (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/src/it/project/postbuild.groovy Sun Jan 22 15:11:16 2017
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+File effectiveSettings = new File( basedir, "effective-settings.xml" )
+assert effectiveSettings.isFile()
+
+def settings = new XmlSlurper().parse( effectiveSettings )
+def server = settings.servers.server.find{ it.id.equals('dummy-it-settings-merge') }
+
+if( !server.password.equals('overridden') )
+ throw new org.apache.maven.plugin.MojoExecutionException("Incorrect server password - specified settings.xml not merged/dominant " + server.password)
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/src/it/settings.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9%2B/src/it/settings.xml?rev=1779824&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/src/it/settings.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/settings-merge_jdk9+/src/it/settings.xml Sun Jan 22 15:11:16 2017
@@ -0,0 +1,42 @@
+<?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.
+-->
+
+<settings>
+ <servers>
+ <server>
+ <id>dummy-it-settings-merge</id>
+ <username>user</username>
+ <password>overridden</password>
+ </server>
+ </servers>
+
+ <profiles>
+ <profile>
+ <id>it-properties</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <it.settings-merge.2>exists</it.settings-merge.2>
+ </properties>
+ </profile>
+ </profiles>
+</settings>