Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty-plugin mode fails with JDK11 #602

Open
jimklimov opened this issue Mar 10, 2023 · 1 comment
Open

empty-plugin mode fails with JDK11 #602

jimklimov opened this issue Mar 10, 2023 · 1 comment
Labels

Comments

@jimklimov
Copy link

jimklimov commented Mar 10, 2023

Jenkins and plugins versions report

Environment
Paste the output here

What Operating System are you using (both controller, and any agents involved in the problem)?

Windows 10 with Git Bash

Reproduction steps

  1. Have JDK11 early in PATH as the default
  2. Run mvn archetype:generate -Dfilter=io.jenkins.archetypes:
  3. Select 1. empty-plugin
  4. Select a name etc. (in my case N for defaults and picked all the group names etc.)

Expected Results

Successful generation (as it does happen when I export JAVA_HOME="C:\Program Files\Eclipse Adoptium\jdk-17.0.3.7-hotspot")

Actual Results

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate (default-cli) on project standalone-pom: could not access constructor: private java.io.File(java.lang.String,java.io.File) with arguments: [Jenkinsfile, C:\continuous-integration\jsl-types] reason: java.lang.IllegalAccessException: class org.codehaus.groovy.reflection.CachedConstructor cannot access a member of class java.io.File (in module java.base) with modifiers "private" -> [Help 1]

Anything else?

Originally PATH pointed to JDK11, even though MVN thought differently - that it has JDK17:

:; mvn -version
Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: C:\progra~1\Apache\maven
Java version: 17.0.3, vendor: Eclipse Adoptium, runtime: C:\Program Files\Eclipse Adoptium\jdk-17.0.3.7-hotspot
Default locale: en_US, platform encoding: Cp1250
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

:; java -version
openjdk version "11.0.17" 2022-10-18
OpenJDK Runtime Environment Temurin-11.0.17+8 (build 11.0.17+8)
OpenJDK 64-Bit Server VM Temurin-11.0.17+8 (build 11.0.17+8, mixed mode)

Exporting JDK17 JAVA_HOME and PATH explicitly did work around the issue:

:; export JAVA_HOME="C:\Program Files\Eclipse Adoptium\jdk-17.0.3.7-hotspot"
:; export PATH="$JAVA_HOME\bin:$PATH"

Still, as JDK11 is supposed to be a supported baseline for Jenkins, I think this is an issue to address (or document at least).

@jimklimov jimklimov added the bug label Mar 10, 2023
@daniel-beck
Copy link
Member

filesToRemove.each {
new File(it, projectPath.toFile()).delete()
}
directoriesToRemove.each {
new File(it, projectPath.toFile()).deleteDir()
}

Looks like it would only affect -DhostOnJenkinsGitHub=false?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants