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

bmarwell pushed a commit to branch jdk8toolchain_win
in repository https://gitbox.apache.org/repos/asf/maven-jlink-plugin.git

commit 7ed7e038bf07525b5b0d6985643f876768dd3e38
Author: Benjamin Marwell <[email protected]>
AuthorDate: Fri Nov 20 12:38:26 2020 +0100

    Toolchain JDK is now available for windows.
    
    See https://github.com/battila7/jdk-via-jabba/issues/6.
---
 .github/workflows/maven.yml                        | 27 ++++++++++++++++++
 .gitignore                                         |  2 --
 .../projects/MJLINK-36_toolchainjdk8/verify.groovy | 32 ++++++++++++++++++++++
 .../projects/MJLINK-36_toolchainjdk9/verify.groovy | 32 ++++++++++++++++++++++
 4 files changed, 91 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index f4fb733..81aa87b 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -42,6 +42,32 @@ jobs:
           restore-keys: |
             maven-${{ matrix.os }}-java${{ matrix.java }}-
             maven-${{ matrix.os }}-
+      - name: Install Toolchain JDK
+        if: ${{ matrix.java == '8' }}
+        uses: battila7/jdk-via-jabba@v1
+        with:
+          jdk: [email protected]
+          javaHomeEnvironmentVariable: TOOLCHAIN_JDK
+      - name: Set up Toolchain
+        if: ${{ matrix.java == '8' }}
+        shell: bash
+        run: |
+          mkdir -p $HOME/.m2 \
+          && cat << EOF > $HOME/.m2/toolchains.xml
+          <?xml version="1.0" encoding="UTF8"?>
+          <toolchains>
+            <toolchain>
+              <type>jdk</type>
+                <provides>
+                  <version>11</version>
+                  <vendor>adopt</vendor>
+                </provides>
+                <configuration>
+                  <jdkHome>${{ env.TOOLCHAIN_JDK }}</jdkHome>
+                </configuration>
+            </toolchain>
+          </toolchains>
+          EOF
       - name: Set up JDK
         uses: actions/setup-java@v1
         with:
@@ -49,3 +75,4 @@ jobs:
 
       - name: Build with Maven
         run: mvn verify -e -B -V -Prun-its
+
diff --git a/.gitignore b/.gitignore
index 4b8cf07..f79c928 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,5 +13,3 @@ out/
 /bootstrap
 /dependencies.xml
 .java-version
-# for testing
-it-toolchains.xml
diff --git a/src/it/projects/MJLINK-36_toolchainjdk8/verify.groovy 
b/src/it/projects/MJLINK-36_toolchainjdk8/verify.groovy
new file mode 100644
index 0000000..d2a215e
--- /dev/null
+++ b/src/it/projects/MJLINK-36_toolchainjdk8/verify.groovy
@@ -0,0 +1,32 @@
+
+/*
+ * 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.io.*
+import java.util.*
+import java.util.jar.*
+import org.codehaus.plexus.util.*
+
+File target = new File( basedir, "target" )
+assert target.isDirectory()
+
+File jarArtifact = new File( target, 
"mjlink36-toolchain-jdk8-1.0.0-SNAPSHOT.zip" )
+assert jarArtifact.isFile()
+
+// optional: check if it contains a launcher script
diff --git a/src/it/projects/MJLINK-36_toolchainjdk9/verify.groovy 
b/src/it/projects/MJLINK-36_toolchainjdk9/verify.groovy
new file mode 100644
index 0000000..86433e4
--- /dev/null
+++ b/src/it/projects/MJLINK-36_toolchainjdk9/verify.groovy
@@ -0,0 +1,32 @@
+
+/*
+ * 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.io.*
+import java.util.*
+import java.util.jar.*
+import org.codehaus.plexus.util.*
+
+File target = new File( basedir, "target" )
+assert target.isDirectory()
+
+File jarArtifact = new File( target, 
"mjlink36-toolchain-jdk9-1.0.0-SNAPSHOT.zip" )
+assert jarArtifact.isFile()
+
+// optional: check if it contains a launcher script

Reply via email to