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

mvn test no longer works in jenkinsci/jenkins #509

Closed
daniel-beck opened this issue Jun 30, 2023 · 2 comments
Closed

mvn test no longer works in jenkinsci/jenkins #509

daniel-beck opened this issue Jun 30, 2023 · 2 comments

Comments

@daniel-beck
Copy link
Member

Jenkins and plugins versions report

n/a

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

n/a

Reproduction steps

mvn clean install -DskipTests && mvn test -Dtest=…

Expected Results

The test is run, build passes (or not) based on test result

Actual Results

[ERROR] Failed to execute goal org.jenkins-ci.tools:maven-hpi-plugin:3.27:test-runtime (test-runtime) on project jenkins-test: Failed to read MANIFEST.MF from /…/war/target/classes: /…/war/target/classes (Is a directory) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jenkins-ci.tools:maven-hpi-plugin:3.27:test-runtime (test-runtime) on project jenkins-test: Failed to read MANIFEST.MF from /…/war/target/classes
…
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to read MANIFEST.MF from /Users/danielbeck/Repositories/github.com/daniel-beck/jenkins/war/target/classes
…
Caused by: java.io.FileNotFoundException: /Users/danielbeck/Repositories/github.com/daniel-beck/jenkins/war/target/classes (Is a directory)
    at java.io.RandomAccessFile.open0 (Native Method)
    at java.io.RandomAccessFile.open (RandomAccessFile.java:345)
    at java.io.RandomAccessFile.<init> (RandomAccessFile.java:259)
    at java.io.RandomAccessFile.<init> (RandomAccessFile.java:214)
    at java.util.zip.ZipFile$Source.<init> (ZipFile.java:1305)
    at java.util.zip.ZipFile$Source.get (ZipFile.java:1271)
    at java.util.zip.ZipFile$CleanableResource.<init> (ZipFile.java:733)
    at java.util.zip.ZipFile$CleanableResource.get (ZipFile.java:850)
    at java.util.zip.ZipFile.<init> (ZipFile.java:248)
    at java.util.zip.ZipFile.<init> (ZipFile.java:177)
    at java.util.jar.JarFile.<init> (JarFile.java:350)
    at java.util.jar.JarFile.<init> (JarFile.java:321)
    at java.util.jar.JarFile.<init> (JarFile.java:287)
    at org.jenkinsci.maven.plugins.hpi.TestRuntimeMojo.getManifestEntry (TestRuntimeMojo.java:93)
    at org.jenkinsci.maven.plugins.hpi.TestRuntimeMojo.setAddOpensProperty (TestRuntimeMojo.java:62)
    at org.jenkinsci.maven.plugins.hpi.TestRuntimeMojo.execute (TestRuntimeMojo.java:52)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

Anything else?

Bisecting identifies jenkinsci/jenkins#6432 as the culprit → https://github.com/jenkinsci/pom/releases/tag/jenkins-1.73#322 / #327

@basil
Copy link
Member

basil commented Jun 30, 2023

I recently asked the security team to fix a regression that was introduced in the same time period (approximately a year ago), and I received a response that the security team does not and has never committed to fixing regressions regardless of when the issue is raised, and when I asked about the relevance of when the issue was raised I received no response.

🤷‍♂️

@daniel-beck
Copy link
Member Author

Interestingly, the issue is no longer reproducible as described since jenkinsci/jenkins#8204. Looking at the diff, this would indicate #506 no longer finds the directory.

Confirmed by adding debug output, which results in the following paths for the file TestRuntimeMojo#getManifestEntry operates on:

  • Old: $HOME/…/war/target/classes
  • New: $HOME/.m2/repository/org/jenkins-ci/main/jenkins-war/2.413-SNAPSHOT/jenkins-war-2.413-SNAPSHOT.war

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

No branches or pull requests

2 participants