apache / maven-mvnd

Apache Maven Daemon
https://maven.apache.org/
Apache License 2.0
2.91k stars 207 forks source link

mvnd is not supported to `<goal>` tag in pom.xml? #859

Closed JPMonty closed 1 year ago

JPMonty commented 1 year ago

the error happens when i execute command mvnd clean package -Dmaven.test.skip for my maven project that can be successfully build with command mvn clean package -Dmaven.test.skip. the error prompts [ERROR] Failed to execute goal org.codehaus.mojo:flatten-maven-plugin:1.3.0:flatten (flatten) on project cdp-profile-application: 1 problem was encountered while building the effective model for D:\IdeaProjects\profile_application\pom.xml [ERROR] [FATAL] Unrecognised tag: 'goals' (position: START_TAG seen ...</version>\n <goals>... @77:16) @ io.netty:netty-bom:4.1.75.Final, C:\Users\Administrator\.m2\repository\io\netty\netty-bom\4.1.75.Final\netty-bom-4.1.75.Final.pom, line 77, column 16 how i resolve thisproblem? whether i need delete the goal tag in my pom.xml file?

gnodet commented 1 year ago

the error happens when i execute command mvnd clean package -Dmaven.test.skip for my maven project that can be successfully build with command mvn clean package -Dmaven.test.skip. the error prompts [ERROR] Failed to execute goal org.codehaus.mojo:flatten-maven-plugin:1.3.0:flatten (flatten) on project cdp-profile-application: 1 problem was encountered while building the effective model for D:\IdeaProjects\profile_application\pom.xml [ERROR] [FATAL] Unrecognised tag: 'goals' (position: START_TAG seen ...</version>\n <goals>... @77:16) @ io.netty:netty-bom:4.1.75.Final, C:\Users\Administrator\.m2\repository\io\netty\netty-bom\4.1.75.Final\netty-bom-4.1.75.Final.pom, line 77, column 16 how i resolve thisproblem? whether i need delete the goal tag in my pom.xml file?

The goals element in plugins is deprecated and support for it has been removed in maven 4. I suppose you're using the m40 distribution which is based on 4.0.0-alpha... So yes, upgrade to a more recent netty where this problem has been fixed, or use the m39 distribution based on maven 3.9.x.

JPMonty commented 1 year ago

the error happens when i execute command mvnd clean package -Dmaven.test.skip for my maven project that can be successfully build with command mvn clean package -Dmaven.test.skip. the error prompts [ERROR] Failed to execute goal org.codehaus.mojo:flatten-maven-plugin:1.3.0:flatten (flatten) on project cdp-profile-application: 1 problem was encountered while building the effective model for D:\IdeaProjects\profile_application\pom.xml [ERROR] [FATAL] Unrecognised tag: 'goals' (position: START_TAG seen ...</version>\n <goals>... @77:16) @ io.netty:netty-bom:4.1.75.Final, C:\Users\Administrator\.m2\repository\io\netty\netty-bom\4.1.75.Final\netty-bom-4.1.75.Final.pom, line 77, column 16 how i resolve thisproblem? whether i need delete the goal tag in my pom.xml file?

The goals element in plugins is deprecated and support for it has been removed in maven 4. I suppose you're using the m40 distribution which is based on 4.0.0-alpha... So yes, upgrade to a more recent netty where this problem has been fixed, or use the m39 distribution based on maven 3.9.x.

thanks.your suppose is exactly right. and the solution as you said is worked when i use m39. by the way, another problem occured in my project. why i use command mvnd clean package -DskipTest=true cannot skip test case execution or test compile. instead, i use command mvnd clean package -Dmaven.test.skip=true the test case can be skiped both execution and compile.