Hi,
If I test with this version the build will fail if I don't set the
modelVersion (empty tag) or remove the entry completely...
~/ws-git/javaee (master *)$
~/tools/maven-test/apache-maven-3.4.0-SNAPSHOT/bin/mvn clean package
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'modelVersion' is missing. @ line 3, column 17
[ERROR] 'modelVersion' is missing. @ line 3, column 17
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.soebes.examples.j2ee:parent:1.1.2-SNAPSHOT
(/Users/kama/ws-git/javaee/pom.xml) has 1 error
[ERROR] 'modelVersion' is missing. @ line 3, column 17
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the
-e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
~/ws-git/javaee (master *)$ git di
diff --git a/pom.xml b/pom.xml
index 8b0e0c8..1761fb6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,6 +1,6 @@
<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>
+ <modelVersion></modelVersion>
<parent>
<groupId>com.soebes.smpp</groupId>
~/ws-git/javaee (master *)$
I'm not sure if it would be better to fail the build as it is at the
moment or only produce WARNING ?
Kind regards
Karl Heinz
On 7/30/16 9:02 PM, [email protected] wrote:
Repository: maven
Updated Branches:
refs/heads/master 2e255c8e4 -> 45a04204f
[MNG-6074] Maven should print a warning if no model version has been set in a
POM file.
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/45a04204
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/45a04204
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/45a04204
Branch: refs/heads/master
Commit: 45a04204f720c9ed9c70c825fdb7834adb83852c
Parents: 2e255c8
Author: Christian Schulte <[email protected]>
Authored: Sat Jul 30 21:02:03 2016 +0200
Committer: Christian Schulte <[email protected]>
Committed: Sat Jul 30 21:02:03 2016 +0200
----------------------------------------------------------------------
.../org/apache/maven/model/validation/DefaultModelValidator.java | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/45a04204/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
----------------------------------------------------------------------
diff --git
a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
index 1d3a0f6..efe8895 100644
---
a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
+++
b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
@@ -101,6 +101,7 @@ public class DefaultModelValidator
{
Severity errOn30 = getSeverity( request,
ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_0 );
+ validateStringNotEmpty( "modelVersion", problems,
Severity.WARNING, Version.V20, m.getModelVersion(), m );
validateEnum( "modelVersion", problems, Severity.ERROR,
Version.V20, m.getModelVersion(), null, m,
"4.0.0" );
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]