Discussion:
Trying to fix integration tests of mvn-site-plugin
Olaf Flebbe
2018-11-18 15:09:52 UTC
Permalink
Hi,

I looked into fixing the Hudson build of maven-site-plugin

https://builds.apache.org/job/maven-box/job/maven-site-plugin/job/master/ <https://builds.apache.org/job/maven-box/job/maven-site-plugin/job/master/>

There are two "it" failing, one of them is the fullreporting. This fullreporting test seems to run something like

mvn -Preporting site


[ERROR] ProjectBuildingException for commons-logging:commons-logging:jar:1.1:compile: Some problems were encountered while processing the POMs:
...
[ERROR] 'distributionManagement.status' must not be specified. @ line 189, column 13

In fact commons-logging pom includes an <status> tag within <distributionManagement> which seems to be not so valid. And there are a couple of other poms with the same "problem".

I do know nothing about the history of this tag and do find a commit in spring-gradle-plugins to work around exactly the same problem
https://github.com/spring-gradle-plugins/dependency-management-plugin/commit/a7fec47ea03bf43bdde5707f43743e225ccae319 <https://github.com/spring-gradle-plugins/dependency-management-plugin/commit/a7fec47ea03bf43bdde5707f43743e225ccae319>

and a discussion that this tag may be obsolete:
https://issues.apache.org/jira/browse/MNG-3178 <https://issues.apache.org/jira/browse/MNG-3178>

I am asking myself if maven should relax the DefaultModelValidator. At least from the Maven Model
https://maven.apache.org/ref/3.6.0/maven-model/maven.html <https://maven.apache.org/ref/3.6.0/maven-model/maven.html> it looks like to be valid.

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 1c8477678..b50b0f2e7 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
@@ -444,12 +444,6 @@ public void validateEffectiveModel( Model m, ModelBuildingRequest request, Model
DistributionManagement distMgmt = m.getDistributionManagement();
if ( distMgmt != null )
{
- if ( distMgmt.getStatus() != null )
- {
- addViolation( problems, Severity.ERROR, Version.V20, "distributionManagement.status", null,
- "must not be specified.", distMgmt );
- }
-
validate20EffectiveRepository( problems, distMgmt.getRepository(), "distributionManagement.repository",
request );
validate20EffectiveRepository( problems, distMgmt.getSnapshotRepository(),


Greetings
Olaf
Robert Scholte
2018-11-18 19:07:44 UTC
Permalink
I would expect there's a difference between the local pom (buildpom) and
the external poms (consumer poms). In case of the latter this tag
shouldn't be an issue, however for the local pom it should.
Poms will now probably go through the same validator.

thanks,
Robert
Post by Olaf Flebbe
Hi,
I looked into fixing the Hudson build of maven-site-plugin
https://builds.apache.org/job/maven-box/job/maven-site-plugin/job/master/
<https://builds.apache.org/job/maven-box/job/maven-site-plugin/job/master/>
There are two "it" failing, one of them is the fullreporting. This
fullreporting test seems to run something like
mvn -Preporting site
[ERROR] ProjectBuildingException for
commons-logging:commons-logging:jar:1.1:compile: Some problems were
...
In fact commons-logging pom includes an <status> tag within
<distributionManagement> which seems to be not so valid. And there are a
couple of other poms with the same "problem".
I do know nothing about the history of this tag and do find a commit in
spring-gradle-plugins to work around exactly the same problem
https://github.com/spring-gradle-plugins/dependency-management-plugin/commit/a7fec47ea03bf43bdde5707f43743e225ccae319
<https://github.com/spring-gradle-plugins/dependency-management-plugin/commit/a7fec47ea03bf43bdde5707f43743e225ccae319>
https://issues.apache.org/jira/browse/MNG-3178
<https://issues.apache.org/jira/browse/MNG-3178>
I am asking myself if maven should relax the DefaultModelValidator. At
least from the Maven Model
https://maven.apache.org/ref/3.6.0/maven-model/maven.html
<https://maven.apache.org/ref/3.6.0/maven-model/maven.html> it looks
like to be valid.
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 1c8477678..b50b0f2e7 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
@@ -444,12 +444,6 @@ public void validateEffectiveModel( Model m,
ModelBuildingRequest request, Model
DistributionManagement distMgmt =
m.getDistributionManagement();
if ( distMgmt != null )
{
- if ( distMgmt.getStatus() != null )
- {
- addViolation( problems, Severity.ERROR,
Version.V20, "distributionManagement.status", null,
- "must not be specified.", distMgmt );
- }
-
validate20EffectiveRepository( problems,
distMgmt.getRepository(), "distributionManagement.repository",
request );
validate20EffectiveRepository( problems,
distMgmt.getSnapshotRepository(),
Greetings
Olaf
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-***@maven.apache.org
For additional commands, e-mail: dev-***@maven.apache.org
Hervé BOUTEMY
2018-11-18 22:54:31 UTC
Permalink
what you describe looks like MPIR-373
AFAIK, this does not fail the build

I tried to run the maven-site-plugin build on my computer and got the 2 failing ITs, and for fullreporting it displays:
[INFO] Building: full-reporting/pom.xml
[INFO] run post-build script verify.groovy
[INFO] full-reporting/pom.xml ........................... FAILED (16.8 s)
[INFO] The post-build script did not succeed. assert new File( sitedir, 'cpd.html' ).exists()
| | |
| | false
| /home/herve/maven-site-plugin/target/it/full-reporting/target/site
/home/herve/maven-site-plugin/target/it/full-reporting/target/site/cpd.html

I don't know why cpd.html is not generated, but it seems unrelated

Regards,

Hervé
Post by Olaf Flebbe
Hi,
I looked into fixing the Hudson build of maven-site-plugin
https://builds.apache.org/job/maven-box/job/maven-site-plugin/job/master/
<https://builds.apache.org/job/maven-box/job/maven-site-plugin/job/master/>
There are two "it" failing, one of them is the fullreporting. This
fullreporting test seems to run something like
mvn -Preporting site
[ERROR] ProjectBuildingException for
commons-logging:commons-logging:jar:1.1:compile: Some problems were
encountered while processing the POMs: ...
In fact commons-logging pom includes an <status> tag within
<distributionManagement> which seems to be not so valid. And there are a
couple of other poms with the same "problem".
I do know nothing about the history of this tag and do find a commit in
spring-gradle-plugins to work around exactly the same problem
https://github.com/spring-gradle-plugins/dependency-management-plugin/commi
t/a7fec47ea03bf43bdde5707f43743e225ccae319
<https://github.com/spring-gradle-plugins/dependency-management-plugin/comm
it/a7fec47ea03bf43bdde5707f43743e225ccae319>
https://issues.apache.org/jira/browse/MNG-3178
<https://issues.apache.org/jira/browse/MNG-3178>
I am asking myself if maven should relax the DefaultModelValidator. At least
from the Maven Model
https://maven.apache.org/ref/3.6.0/maven-model/maven.html
<https://maven.apache.org/ref/3.6.0/maven-model/maven.html> it looks like
to be valid.
diff --git
a/maven-model-builder/src/main/java/org/apache/maven/model/validation/Defau
ltModelValidator.java
b/maven-model-builder/src/main/java/org/apache/maven/model/validation/Defau
ltModelValidator.java index 1c8477678..b50b0f2e7 100644
---
a/maven-model-builder/src/main/java/org/apache/maven/model/validation/Defau
ltModelValidator.java +++
b/maven-model-builder/src/main/java/org/apache/maven/model/validation/Defau
validateEffectiveModel( Model m, ModelBuildingRequest request, Model
DistributionManagement distMgmt = m.getDistributionManagement(); if (
distMgmt != null )
{
- if ( distMgmt.getStatus() != null )
- {
- addViolation( problems, Severity.ERROR, Version.V20,
"distributionManagement.status", null, -
"must not be specified.", distMgmt ); - }
-
validate20EffectiveRepository( problems,
distMgmt.getRepository(), "distributionManagement.repository", request );
validate20EffectiveRepository( problems,
distMgmt.getSnapshotRepository(),
Greetings
Olaf
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-***@maven.apache.org
For additional commands, e-mail: dev-***@maven.apache.org

Loading...