Uploaded image for project: 'Apache NetBeans Infra'
  1. Apache NetBeans Infra
  2. NETBEANSINFRA-274

nbm-maven-plugin fails to package when running on Oracle JDK 8

    XMLWordPrintableJSON

Details

    Description

      We are running a build with the 4.8 version of nbm-maven-plugin, which shows different behavior according to the JDK being used.

       

      On following context:
      Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
      Maven home: C:\Users\...\P\J\apache-maven-3.8.5
      Java version: 1.8.0_332, vendor: Temurin, runtime: c:\Users\...\p\j\jdk8u332-b09\jre
      Default locale: pt_BR, platform encoding: Cp1252
      OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

      Result: Build succeeds as expected

       

      On following context:
      Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
      Maven home: C:\Users\...\P\J\apache-maven-3.8.5
      Java version: 1.8.0_281, vendor: Oracle Corporation, runtime: c:\users\...\P\j\jdk-8u281\jre
      Default locale: pt_BR, platform encoding: Cp1252
      OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

      Result: Builds fails with following exception:
      ERROR] Failed to execute goal org.apache.netbeans.utilities:nbm-maven-plugin:4.8:nbm (default-nbm) on project apache-commons-libs: Could not overwrite manifest entry: META-INF/MANIFEST.MF -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.netbeans.utilities:nbm-maven-plugin:4.8:nbm (default-nbm) on project apache-commons-libs: Could not overwrite manifest entry
          at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:306)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
          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:127)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
          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:960)
          at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
          at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
          at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:498)
          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)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Could not overwrite manifest entry
          at org.apache.netbeans.nbm.CreateNetBeansFileStructure.execute (CreateNetBeansFileStructure.java:309)
          at org.apache.netbeans.nbm.CreateNbmMojo.execute (CreateNbmMojo.java:206)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
          at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:301)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
          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:127)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
          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:960)
          at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
          at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
          at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:498)
          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)
      Caused by: java.nio.file.FileAlreadyExistsException: META-INF/MANIFEST.MF
          at com.sun.nio.zipfs.ZipFileSystem.newOutputStream (ZipFileSystem.java:516)
          at com.sun.nio.zipfs.ZipPath.newOutputStream (ZipPath.java:790)
          at com.sun.nio.zipfs.ZipFileSystemProvider.newOutputStream (ZipFileSystemProvider.java:285)
          at java.nio.file.Files.newOutputStream (Files.java:216)
          at org.apache.netbeans.nbm.CreateNetBeansFileStructure.execute (CreateNetBeansFileStructure.java:303)
          at org.apache.netbeans.nbm.CreateNbmMojo.execute (CreateNbmMojo.java:206)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
          at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:301)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
          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:127)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
          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:960)
          at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
          at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
          at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:498)
          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)

       

      Our investigation revealed that from version 4.6 on, the plugin started using mode modern approach to generate or update .jar files, now using javax.nio. However, Oracle and Temurin are not following the same criteria when updating a file that is already contained in the .jar file...

      Attachments

        Activity

          People

            Unassigned Unassigned
            danielferber Daniel Felix Ferber
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: