[jira] (MNG-5091) Add option to fail build if WARNING's appear in POM
[ https://jira.codehaus.org/browse/MNG-5091?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robert Scholte updated MNG-5091: Fix Version/s: (was: 3.2) > Add option to fail build if WARNING's appear in POM > --- > > Key: MNG-5091 > URL: https://jira.codehaus.org/browse/MNG-5091 > Project: Maven 2 & 3 > Issue Type: Improvement > Components: Command Line, POM >Affects Versions: 3.0.3 >Reporter: Karl Heinz Marbaise >Priority: Minor > Attachments: MNG-5091-maven-embedder.patch > > > It would be nice to have the option to let a build fail if something like > this will appear: > {code} > [INFO] Scanning for projects... > [WARNING] > [WARNING] Some problems were encountered while building the effective model > for com.soebes.training.module:050-project-without-warnings:jar:0.1.0-SNAPSHOT > [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must > be unique: org.slf4j:slf4j-api:jar -> duplicate declaration of version 1.6.1 > @ line 28, column 14 > [WARNING] > [WARNING] It is highly recommended to fix these problems because they > threaten the stability of your build. > [WARNING] > [WARNING] For this reason, future Maven versions might no longer support > building such malformed projects. > [WARNING] > {code} > This shoud be done for WARNING's in case of missing versions for plugins etc. > Currently it is possible to set the Validation leven in Jenkins/Hudson > already but it is not possible on command line. So an option on command line > like: > {code} > mvn --fail-warning ... > {code} > would be great. Or may be a good supplemental option to set the validation > level like: > {code} > mvn --validation-level MINIMAL > mvn --validation-level MAVEN20 > mvn --validation-level MAVEN30 > mvn --validation-level MAVEN31 > mvn --validation-level DEFAULT > {code} > or may be both. May this might be an enhancement for Maven 3.0.4 ? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (MNG-5091) Add option to fail build if WARNING's appear in POM
[ https://jira.codehaus.org/browse/MNG-5091?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jason van Zyl updated MNG-5091: --- Fix Version/s: (was: 3.1.x) 3.2 > Add option to fail build if WARNING's appear in POM > --- > > Key: MNG-5091 > URL: https://jira.codehaus.org/browse/MNG-5091 > Project: Maven 2 & 3 > Issue Type: Improvement > Components: Command Line, POM >Affects Versions: 3.0.3 >Reporter: Karl Heinz Marbaise >Priority: Minor > Fix For: 3.2 > > Attachments: MNG-5091-maven-embedder.patch > > > It would be nice to have the option to let a build fail if something like > this will appear: > {code} > [INFO] Scanning for projects... > [WARNING] > [WARNING] Some problems were encountered while building the effective model > for com.soebes.training.module:050-project-without-warnings:jar:0.1.0-SNAPSHOT > [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must > be unique: org.slf4j:slf4j-api:jar -> duplicate declaration of version 1.6.1 > @ line 28, column 14 > [WARNING] > [WARNING] It is highly recommended to fix these problems because they > threaten the stability of your build. > [WARNING] > [WARNING] For this reason, future Maven versions might no longer support > building such malformed projects. > [WARNING] > {code} > This shoud be done for WARNING's in case of missing versions for plugins etc. > Currently it is possible to set the Validation leven in Jenkins/Hudson > already but it is not possible on command line. So an option on command line > like: > {code} > mvn --fail-warning ... > {code} > would be great. Or may be a good supplemental option to set the validation > level like: > {code} > mvn --validation-level MINIMAL > mvn --validation-level MAVEN20 > mvn --validation-level MAVEN30 > mvn --validation-level MAVEN31 > mvn --validation-level DEFAULT > {code} > or may be both. May this might be an enhancement for Maven 3.0.4 ? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (MNG-5091) Add option to fail build if WARNING's appear in POM
[ https://jira.codehaus.org/browse/MNG-5091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=332032#comment-332032 ] Derek Lewis commented on MNG-5091: -- I started writing a plugin to do this a while ago. It's still fairly immature, but it's been useful to myself and others. https://github.com/lewisd32/lint-maven-plugin > Add option to fail build if WARNING's appear in POM > --- > > Key: MNG-5091 > URL: https://jira.codehaus.org/browse/MNG-5091 > Project: Maven 2 & 3 > Issue Type: Improvement > Components: Command Line, POM >Affects Versions: 3.0.3 >Reporter: Karl Heinz Marbaise >Priority: Minor > Fix For: 3.1.x > > Attachments: MNG-5091-maven-embedder.patch > > > It would be nice to have the option to let a build fail if something like > this will appear: > {code} > [INFO] Scanning for projects... > [WARNING] > [WARNING] Some problems were encountered while building the effective model > for com.soebes.training.module:050-project-without-warnings:jar:0.1.0-SNAPSHOT > [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must > be unique: org.slf4j:slf4j-api:jar -> duplicate declaration of version 1.6.1 > @ line 28, column 14 > [WARNING] > [WARNING] It is highly recommended to fix these problems because they > threaten the stability of your build. > [WARNING] > [WARNING] For this reason, future Maven versions might no longer support > building such malformed projects. > [WARNING] > {code} > This shoud be done for WARNING's in case of missing versions for plugins etc. > Currently it is possible to set the Validation leven in Jenkins/Hudson > already but it is not possible on command line. So an option on command line > like: > {code} > mvn --fail-warning ... > {code} > would be great. Or may be a good supplemental option to set the validation > level like: > {code} > mvn --validation-level MINIMAL > mvn --validation-level MAVEN20 > mvn --validation-level MAVEN30 > mvn --validation-level MAVEN31 > mvn --validation-level DEFAULT > {code} > or may be both. May this might be an enhancement for Maven 3.0.4 ? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (MNG-5091) Add option to fail build if WARNING's appear in POM
[ https://jira.codehaus.org/browse/MNG-5091?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robert Scholte closed MNG-5091. --- Resolution: Won't Fix I think it is much easier to solve this with an enforcer rule. The {{fail-on-warning}} option is probably not the correct solution right now, because there will be a big chance people will expect the build to fail when any warning is logged. Up to Maven-3.0.5 there's not enough control over the logging, but that might change with 3.1.x Since you want such validation for every time you do the build (and not just by an additional cmd-line option) it should be solved with a maven-plugin: another reason to add this as an enforcer-rule. > Add option to fail build if WARNING's appear in POM > --- > > Key: MNG-5091 > URL: https://jira.codehaus.org/browse/MNG-5091 > Project: Maven 2 & 3 > Issue Type: Improvement > Components: Command Line, POM >Affects Versions: 3.0.3 >Reporter: Karl Heinz Marbaise >Priority: Minor > Fix For: 3.1.x > > Attachments: MNG-5091-maven-embedder.patch > > > It would be nice to have the option to let a build fail if something like > this will appear: > {code} > [INFO] Scanning for projects... > [WARNING] > [WARNING] Some problems were encountered while building the effective model > for com.soebes.training.module:050-project-without-warnings:jar:0.1.0-SNAPSHOT > [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must > be unique: org.slf4j:slf4j-api:jar -> duplicate declaration of version 1.6.1 > @ line 28, column 14 > [WARNING] > [WARNING] It is highly recommended to fix these problems because they > threaten the stability of your build. > [WARNING] > [WARNING] For this reason, future Maven versions might no longer support > building such malformed projects. > [WARNING] > {code} > This shoud be done for WARNING's in case of missing versions for plugins etc. > Currently it is possible to set the Validation leven in Jenkins/Hudson > already but it is not possible on command line. So an option on command line > like: > {code} > mvn --fail-warning ... > {code} > would be great. Or may be a good supplemental option to set the validation > level like: > {code} > mvn --validation-level MINIMAL > mvn --validation-level MAVEN20 > mvn --validation-level MAVEN30 > mvn --validation-level MAVEN31 > mvn --validation-level DEFAULT > {code} > or may be both. May this might be an enhancement for Maven 3.0.4 ? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (MNG-5091) Add option to fail build if WARNING's appear in POM
[ https://jira.codehaus.org/browse/MNG-5091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=315371#comment-315371 ] Steven Swor edited comment on MNG-5091 at 12/10/12 5:54 PM: As a workaround, you can use the GMaven plugin to set the validation level during the Maven build. Here's an example which checks the validation level during the {{validate}} phase and fails the build if it's above {{org.apache.maven.model.building.ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0}}. Add the following to your {{project.build.plugins}} section {code} org.codehaus.gmaven gmaven-plugin 1.5 2.0 change-validation-level validate execute def desiredValidationLevel = org.apache.maven.model.building.ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0 def request = session.request.projectBuildingRequest if (request.validationLevel > desiredValidationLevel) { /* * Comment out the following line and uncomment the two below * to coerce the validation level instead of failing the build */ throw new RuntimeException("Validation level is too high") // log.warn("Correcting validation level. Was {}. Now {}", request.validationLevel, desiredValidationLevel) // request.validationLevel = desiredValidationLevel } org.codehaus.groovy groovy-all 2.0.5 org.codehaus.gmaven.runtime gmaven-runtime-2.0 1.5 org.codehaus.groovy groovy-all {code} Note: I'm not sure if forcing GMaven to use Groovy 2 is required. I just copied an existing usage of the plugin and tweaked it for this example. The trick works because gmaven injects the {{MavenSession}} into the script, which has access to the {{ProjectBuildingRequest}} via its {{MavenExecutionRequest}}. I'd suggest having a look at the Maven core API docs and maven build API docs. You might be able to get access to the warnings somehow. was (Author: sworisbreathing): As a workaround, you can use the GMaven plugin to set the validation level during the Maven build. Here's an example which checks the validation level during the {{validate}} phase and fails the build if it's above {{org.apache.maven.model.building.ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0}}. Add the following to your {{project.build.plugins}} section {code} org.codehaus.gmaven gmaven-plugin 1.5 2.0 change-validation-level validate execute def desiredValidationLevel = org.apache.maven.model.building.ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0 def request = session.request.projectBuildingRequest if (request.validationLevel > desiredValidationLevel) { /* * Comment out the following line and uncomment the two below * to coerce the validation level instead of failing the build */ throw new RuntimeException("Validation level is too high") // log.warn("Correcting validation level. Was {}. Now {}", request.validationLevel, desiredValidationLevel) // request.validationLevel = desiredValidationLevel } org.codehaus.groovy groovy-all 2.0.5 org.codehaus.gmaven.runtime gmaven-runtime-2.0 1.5 org.codehaus.groovy groovy-all {code} Note: I'm not sure if forcing GMaven to use Groovy 2 is required. I just copied an existing usage of the plugin and tweaked it for this example. > Add option to fail build if WARNING's appear in POM > --- > > Key: MNG-5091 > URL: https://jira.codehaus.org/browse/MNG-5091 > Project: Maven 2 & 3 > Issue Type: Improvement > Components: Command Line, POM >Affects V
[jira] (MNG-5091) Add option to fail build if WARNING's appear in POM
[ https://jira.codehaus.org/browse/MNG-5091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=315371#comment-315371 ] Steven Swor edited comment on MNG-5091 at 12/10/12 5:51 PM: As a workaround, you can use the GMaven plugin to set the validation level during the Maven build. Here's an example which checks the validation level during the {{validate}} phase and fails the build if it's above {{org.apache.maven.model.building.ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0}}. Add the following to your {{project.build.plugins}} section {code} org.codehaus.gmaven gmaven-plugin 1.5 2.0 change-validation-level validate execute def desiredValidationLevel = org.apache.maven.model.building.ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0 def request = session.request.projectBuildingRequest if (request.validationLevel > desiredValidationLevel) { /* * Comment out the following line and uncomment the two below * to coerce the validation level instead of failing the build */ throw new RuntimeException("Validation level is too high") // log.warn("Correcting validation level. Was {}. Now {}", request.validationLevel, desiredValidationLevel) // request.validationLevel = desiredValidationLevel } org.codehaus.groovy groovy-all 2.0.5 org.codehaus.gmaven.runtime gmaven-runtime-2.0 1.5 org.codehaus.groovy groovy-all {code} Note: I'm not sure if forcing GMaven to use Groovy 2 is required. I just copied an existing usage of the plugin and tweaked it for this example. was (Author: sworisbreathing): As a workaround, you can use the GMaven plugin to set the validation level during the Maven build. Here's an example which coerces it down to {{org.apache.maven.model.building.ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0}} during the {{validate}} phase. Add the following to your {{project.build.plugins}} section {code} org.codehaus.gmaven gmaven-plugin 1.5 2.0 change-validation-level validate execute def desiredValidationLevel = org.apache.maven.model.building.ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0 def request = session.request.projectBuildingRequest if (request.validationLevel > desiredValidationLevel) { log.warn("Correcting validation level. Was {}. Now {}", request.validationLevel, desiredValidationLevel) request.validationLevel = desiredValidationLevel } org.codehaus.groovy groovy-all 2.0.5 org.codehaus.gmaven.runtime gmaven-runtime-2.0 1.5 org.codehaus.groovy groovy-all {code} Note: I'm not sure if forcing GMaven to use Groovy 2 is required. I just copied an existing usage of the plugin and tweaked it for this example. > Add option to fail build if WARNING's appear in POM > --- > > Key: MNG-5091 > URL: https://jira.codehaus.org/browse/MNG-5091 > Project: Maven 2 & 3 > Issue Type: Improvement > Components: Command Line, POM >Affects Versions: 3.0.3 >Reporter: Karl Heinz Marbaise >Priority: Minor > Fix For: 3.1.x > > Attachments: MNG-5091-maven-embedder.patch > > > It would be nice to have the option to let a build fail if something like > this will appear: > {code} > [INFO] Scanning for projects... > [WARNING] > [WARNING] Some problems were encountered while building the effective model > for com.soebes.training.module:050-project-without-warnings:jar:0.1.0-SNAPSHOT > [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must > be unique: org.slf4j:slf4j-api:jar -> duplicate declaration of version 1.6.1 > @ line 28, co
[jira] (MNG-5091) Add option to fail build if WARNING's appear in POM
[ https://jira.codehaus.org/browse/MNG-5091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=315371#comment-315371 ] Steven Swor commented on MNG-5091: -- As a workaround, you can use the GMaven plugin to set the validation level during the Maven build. Here's an example which coerces it down to {{org.apache.maven.model.building.ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0}} during the {{validate}} phase. Add the following to your {{project.build.plugins}} section {code} org.codehaus.gmaven gmaven-plugin 1.5 2.0 change-validation-level validate execute def desiredValidationLevel = org.apache.maven.model.building.ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0 def request = session.request.projectBuildingRequest if (request.validationLevel > desiredValidationLevel) { log.warn("Correcting validation level. Was {}. Now {}", request.validationLevel, desiredValidationLevel) request.validationLevel = desiredValidationLevel } org.codehaus.groovy groovy-all 2.0.5 org.codehaus.gmaven.runtime gmaven-runtime-2.0 1.5 org.codehaus.groovy groovy-all {code} Note: I'm not sure if forcing GMaven to use Groovy 2 is required. I just copied an existing usage of the plugin and tweaked it for this example. > Add option to fail build if WARNING's appear in POM > --- > > Key: MNG-5091 > URL: https://jira.codehaus.org/browse/MNG-5091 > Project: Maven 2 & 3 > Issue Type: Improvement > Components: Command Line, POM >Affects Versions: 3.0.3 >Reporter: Karl Heinz Marbaise >Priority: Minor > Fix For: 3.1.x > > Attachments: MNG-5091-maven-embedder.patch > > > It would be nice to have the option to let a build fail if something like > this will appear: > {code} > [INFO] Scanning for projects... > [WARNING] > [WARNING] Some problems were encountered while building the effective model > for com.soebes.training.module:050-project-without-warnings:jar:0.1.0-SNAPSHOT > [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must > be unique: org.slf4j:slf4j-api:jar -> duplicate declaration of version 1.6.1 > @ line 28, column 14 > [WARNING] > [WARNING] It is highly recommended to fix these problems because they > threaten the stability of your build. > [WARNING] > [WARNING] For this reason, future Maven versions might no longer support > building such malformed projects. > [WARNING] > {code} > This shoud be done for WARNING's in case of missing versions for plugins etc. > Currently it is possible to set the Validation leven in Jenkins/Hudson > already but it is not possible on command line. So an option on command line > like: > {code} > mvn --fail-warning ... > {code} > would be great. Or may be a good supplemental option to set the validation > level like: > {code} > mvn --validation-level MINIMAL > mvn --validation-level MAVEN20 > mvn --validation-level MAVEN30 > mvn --validation-level MAVEN31 > mvn --validation-level DEFAULT > {code} > or may be both. May this might be an enhancement for Maven 3.0.4 ? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (MNG-5091) Add option to fail build if WARNING's appear in POM
[ https://jira.codehaus.org/browse/MNG-5091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=315365#comment-315365 ] Steven Swor commented on MNG-5091: -- Any chance the patch with the {{--validation-level}} switch will make it into 3.0.x? > Add option to fail build if WARNING's appear in POM > --- > > Key: MNG-5091 > URL: https://jira.codehaus.org/browse/MNG-5091 > Project: Maven 2 & 3 > Issue Type: Improvement > Components: Command Line, POM >Affects Versions: 3.0.3 >Reporter: Karl Heinz Marbaise >Priority: Minor > Fix For: 3.1.x > > Attachments: MNG-5091-maven-embedder.patch > > > It would be nice to have the option to let a build fail if something like > this will appear: > {code} > [INFO] Scanning for projects... > [WARNING] > [WARNING] Some problems were encountered while building the effective model > for com.soebes.training.module:050-project-without-warnings:jar:0.1.0-SNAPSHOT > [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must > be unique: org.slf4j:slf4j-api:jar -> duplicate declaration of version 1.6.1 > @ line 28, column 14 > [WARNING] > [WARNING] It is highly recommended to fix these problems because they > threaten the stability of your build. > [WARNING] > [WARNING] For this reason, future Maven versions might no longer support > building such malformed projects. > [WARNING] > {code} > This shoud be done for WARNING's in case of missing versions for plugins etc. > Currently it is possible to set the Validation leven in Jenkins/Hudson > already but it is not possible on command line. So an option on command line > like: > {code} > mvn --fail-warning ... > {code} > would be great. Or may be a good supplemental option to set the validation > level like: > {code} > mvn --validation-level MINIMAL > mvn --validation-level MAVEN20 > mvn --validation-level MAVEN30 > mvn --validation-level MAVEN31 > mvn --validation-level DEFAULT > {code} > or may be both. May this might be an enhancement for Maven 3.0.4 ? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira