You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ad...@apache.org on 2020/10/26 17:14:22 UTC

[maven-pmd-plugin] branch test-INFRA-20938 created (now 5665cff)

This is an automated email from the ASF dual-hosted git repository.

adangel pushed a change to branch test-INFRA-20938
in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git.


      at 5665cff  [MPMD-304] Use proper toolchain config in integration tests

This branch includes the following new commits:

     new 5665cff  [MPMD-304] Use proper toolchain config in integration tests

The 1 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.



[maven-pmd-plugin] 01/01: [MPMD-304] Use proper toolchain config in integration tests

Posted by ad...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

adangel pushed a commit to branch test-INFRA-20938
in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git

commit 5665cffbd0fded024086f1f02eb3ae09fd0f196f
Author: Andreas Dangel <ad...@apache.org>
AuthorDate: Mon Oct 26 18:06:08 2020 +0100

    [MPMD-304] Use proper toolchain config in integration tests
    
    Thanks to INFRA-20938 there is exists now a toolchains.xml
    under Windows as well.
---
 .../MPMD-304-toolchain-support/invoker.properties  | 16 +++---
 src/it/MPMD-304-toolchain-support/selector.groovy  | 65 ----------------------
 .../toolchains.windows.xml                         | 36 ------------
 3 files changed, 7 insertions(+), 110 deletions(-)

diff --git a/src/it/MPMD-304-toolchain-support/invoker.properties b/src/it/MPMD-304-toolchain-support/invoker.properties
index 198db8b..d8e8d01 100644
--- a/src/it/MPMD-304-toolchain-support/invoker.properties
+++ b/src/it/MPMD-304-toolchain-support/invoker.properties
@@ -19,14 +19,12 @@ invoker.java.version = 1.7+
 
 # available toolchains under linux:
 # https://github.com/apache/infrastructure-p6/blob/production/modules/build_nodes/files/toolchains.xml
-# the jdk toolchain "11:oracle" is selected in pom.xml
+# https://github.com/apache/infrastructure-puppet/blob/deployment/modules/build_slaves/files/toolchains.xml
+# available toolchains under windows:
+# https://github.com/apache/infrastructure-puppet/blob/deployment/environments/windows/modules/jenkins_node_windows/files/toolchains.xml
 
-# since the toolchains are only configured under linux slaves
-# we don't use invoker selections here, but selector.groovy
-#invoker.toolchain.jdk.version = 11
-#invoker.toolchain.jdk.vendor = oracle
+# the jdk toolchain "11:oracle" is selected in pom.xml
+invoker.toolchain.jdk.version = 11
+invoker.toolchain.jdk.vendor = oracle
 
-# the file toolchains.xml will be created by selector.groovy
-# - for linux, ${user.home}/.m2/toolchains.xml will be copied
-# - for windows, a new file will be created using toolchains.windows.xml, see selector.groovy
-invoker.goals = clean verify --toolchains toolchains.xml
+invoker.goals = clean verify
diff --git a/src/it/MPMD-304-toolchain-support/selector.groovy b/src/it/MPMD-304-toolchain-support/selector.groovy
deleted file mode 100644
index 55abd8b..0000000
--- a/src/it/MPMD-304-toolchain-support/selector.groovy
+++ /dev/null
@@ -1,65 +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.
- */
-
-File testToolchains = new File( basedir, 'toolchains.xml' )
-
-File userToolchains = new File( System.getProperty( 'user.home' ), '.m2/toolchains.xml' )
-if ( userToolchains.exists() )
-{
-    System.out.println( "INFO: Copying ${userToolchains.absolutePath} to ${testToolchains.absolutePath}" )
-    testToolchains.text = userToolchains.text
-}
-else
-{
-    System.out.println( "WARNING: File ${userToolchains.absolutePath} not found" )
-    if ( System.getProperty( 'os.name' ).startsWith( 'Windows' ) )
-    {
-        String jdk11Windows = 'f:\\jenkins\\tools\\java\\latest11'
-        File windowsToolchains = new File( basedir, 'toolchains.windows.xml' )
-        System.out.println( "INFO: Creating ${testToolchains.absolutePath} with jdk:11:oracle=${jdk11Windows}" )
-
-        String placeholder = '@jdk.home@'
-        String replacement = jdk11Windows
-        // extra escaping of backslashes in the path for Windows
-        replacement = replacement.replaceAll("\\\\", "\\\\\\\\")
-        testToolchains.text = windowsToolchains.text.replaceAll( placeholder, replacement )
-        System.out.println( "Replaced '${placeholder}' with '${replacement}' in '${testToolchains.absolutePath}'." )
-    }
-}
-
-if ( testToolchains.exists() )
-{
-    def toolchains = new XmlParser().parseText( testToolchains.text )
-    def result = toolchains.children().find { toolchain ->
-            toolchain.type.text() == 'jdk' &&
-            toolchain.provides.version.text() == '11' &&
-            toolchain.provides.vendor.text() == 'oracle'
-    }
-    if ( !result )
-    {
-        System.out.println( "WARNING: No jdk toolchain for 11:oracle found" )
-        return false
-    }
-
-    System.out.println( "INFO: Found toolchain: ${result}" )
-    return true
-}
-
-System.out.println( "WARNING: Skipping integration test due to missing toolchain" )
-return false
diff --git a/src/it/MPMD-304-toolchain-support/toolchains.windows.xml b/src/it/MPMD-304-toolchain-support/toolchains.windows.xml
deleted file mode 100644
index e3acb90..0000000
--- a/src/it/MPMD-304-toolchain-support/toolchains.windows.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF8"?>
-
-<!--
-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.
--->
-
-<toolchains xmlns="http://maven.apache.org/TOOLCHAINS/1.1.0"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="http://maven.apache.org/TOOLCHAINS/1.1.0 http://maven.apache.org/xsd/toolchains-1.1.0.xsd">
-    <toolchain>
-        <type>jdk</type>
-        <provides>
-            <version>11</version>
-            <vendor>oracle</vendor>
-        </provides>
-        <configuration>
-            <!-- this placeholder will be replaced by selector.groovy -->
-            <jdkHome>@jdk.home@</jdkHome>
-        </configuration>
-    </toolchain>
-</toolchains>