Skip to content
This repository has been archived by the owner on Jan 21, 2019. It is now read-only.

nbm-maven-plugin 4.1 failing build when including newest build of log4j2 (2.9.1) #30

Closed
lpiet opened this issue Nov 1, 2017 · 12 comments · Fixed by #31
Closed

nbm-maven-plugin 4.1 failing build when including newest build of log4j2 (2.9.1) #30

lpiet opened this issue Nov 1, 2017 · 12 comments · Fixed by #31

Comments

@lpiet
Copy link

lpiet commented Nov 1, 2017

<Edited: To fix a unrelated config mistake in the example pom>

Not entirely sure why. I;ve included a stripped pom which fails when building. As well as the received stack trace. It does build when either the nbm-maven plugin is downgraded to 3.* or the version of log4j2 is downgraded to 2.8.*


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>test</groupId>
    <artifactId>nbmtest</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>nbm</packaging>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>nbm-maven-plugin</artifactId>
                <extensions>true</extensions>
                <version>4.1</version>
            </plugin>
        <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>               
                <version>3.0.2</version>
                <configuration>
                    <archive>
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    
        <dependencies>
             <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-jul</artifactId>
            <version>2.9.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>2.9.1</version>
        </dependency>
        
          <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.9.1</version>
            <type>jar</type>
        </dependency>
           
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>2.9.1</version>
        </dependency>
    </dependencies>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
</project>

stacktrace:

Failed to execute goal org.codehaus.mojo:nbm-maven-plugin:4.1:manifest (default-manifest) on project nbmtest: Execution default-manifest of goal org.codehaus.mojo:nbm-maven-plugin:4.1:manifest failed. IllegalArgumentException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:nbm-maven-plugin:4.1:manifest (default-manifest) on project nbmtest: Execution default-manifest of goal org.codehaus.mojo:nbm-maven-plugin:4.1:manifest failed.
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
	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:290)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-manifest of goal org.codehaus.mojo:nbm-maven-plugin:4.1:manifest failed.
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
	... 19 more
Caused by: java.lang.IllegalArgumentException
	at org.objectweb.asm.ClassReader.<init>(Unknown Source)
	at org.objectweb.asm.ClassReader.<init>(Unknown Source)
	at org.objectweb.asm.ClassReader.<init>(Unknown Source)
	at org.apache.maven.shared.dependency.analyzer.asm.DependencyClassFileVisitor.visitClass(DependencyClassFileVisitor.java:65)
	at org.apache.maven.shared.dependency.analyzer.ClassFileVisitorUtils.visitClass(ClassFileVisitorUtils.java:163)
	at org.apache.maven.shared.dependency.analyzer.ClassFileVisitorUtils.acceptJar(ClassFileVisitorUtils.java:107)
	at org.apache.maven.shared.dependency.analyzer.ClassFileVisitorUtils.accept(ClassFileVisitorUtils.java:61)
	at org.apache.maven.shared.dependency.analyzer.asm.ASMDependencyAnalyzer.analyze(ASMDependencyAnalyzer.java:50)
	at org.codehaus.mojo.nbm.NetBeansManifestUpdateMojo.buildDependencyClasses(NetBeansManifestUpdateMojo.java:920)
	at org.codehaus.mojo.nbm.NetBeansManifestUpdateMojo.buildProjectDependencyClasses(NetBeansManifestUpdateMojo.java:763)
	at org.codehaus.mojo.nbm.NetBeansManifestUpdateMojo.checkModuleClassPath(NetBeansManifestUpdateMojo.java:667)
	at org.codehaus.mojo.nbm.NetBeansManifestUpdateMojo.execute(NetBeansManifestUpdateMojo.java:530)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
	... 20 more

Might be that this needs to reported elsewhere as well in which case any advice on wihch team to approach would be appreciated.

@ebarboni
Copy link
Contributor

ebarboni commented Nov 1, 2017

Hi, maven jar plugin
true is not working now
you need to change configuration like that :




${project.build.outputDirectory}/META-INF/MANIFEST.MF

hope it helps

@lpiet
Copy link
Author

lpiet commented Nov 1, 2017

Hi,

apologies, replacing with:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>               
                <version>3.0.2</version>
                <configuration>
                    <archive>
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                </configuration>
            </plugin>

fixes the issue with the maven-jar-plugin (only occurred because i bumped that version for the example) .

It still won't compile though due to the illegal argument exception thrown by the nbm-plugin.

@mkleint
Copy link
Contributor

mkleint commented Nov 3, 2017

@pgharron
Copy link

Hi Ipiet, did you manage to find a solution for this - I have the same problem ;-(

Thanks
Phil

@ebarboni
Copy link
Contributor

Hi @pgharron, if you have the possibility to build nbm plugin from lastest source and use it it should work.

maybe @mkleint may do a release.

Regards
Eric

@pgharron
Copy link

Thanks, @ebarboni I've downgraded the plugin for now but obviously, I'd rather have the latest version so I may get the latest source and give it a try as suggested.

Regards
Phil

@jessiwyne
Copy link

hi i am having the same issue, any suggestions?

@scharfstein-dev
Copy link

I'm having the same issue. @mkleint, any chance of a release? Apparently this is already fixed on master.

@ebarboni
Copy link
Contributor

hi @scharfstein-dev we are about to migrate nbm-maven-plugin and utilities to apache. We will rebrand and do release in a near future. It's a long process but it's in progress

@scharfstein-dev
Copy link

@ebarboni Good to know, thanks for the info! Good luck with the move and the upcoming release :)

@kpenrose
Copy link

kpenrose commented Nov 5, 2018

I have the same problem when using the 4.1 version of nbm-maven-plugin, however, for me it was triggered when java 8.0_191 was released. Didn't have the problem with 181. Not able to build any of my netbeans modules, as they all die in the maven install path with the default-manifest error.

@SamSharaf
Copy link

@kpenrose @ebarboni @scharfstein-dev
Hi all,
Duplicate of #42

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

Successfully merging a pull request may close this issue.

8 participants