-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[MNG-4921] Add qualityManagement element to POM model 4.2.0 #12842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
slachiewicz
wants to merge
3
commits into
master
Choose a base branch
from
feature/maven-4.1-MNG-4921-quality-management
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -358,6 +358,19 @@ | |
| </association> | ||
| </field> | ||
|
|
||
| <!-- ====================================================================== --> | ||
| <!-- Quality Management --> | ||
| <!-- ====================================================================== --> | ||
|
|
||
| <field> | ||
| <name>qualityManagement</name> | ||
| <version>4.2.0+</version> | ||
| <description>The project's quality management information.</description> | ||
| <association> | ||
| <type>QualityManagement</type> | ||
| </association> | ||
| </field> | ||
|
|
||
| <!-- ====================================================================== --> | ||
| <!-- Build --> | ||
| <!-- ====================================================================== --> | ||
|
|
@@ -1485,6 +1498,50 @@ | |
| </codeSegment> | ||
| </codeSegments> | ||
| </class> | ||
| <class> | ||
| <name>QualityManagement</name> | ||
| <description> | ||
| <![CDATA[ | ||
| The {@code <qualityManagement>} element contains information required to the | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. required by and again this should be fleshed out. I've never encountered anything like this. |
||
| quality management system of the project. | ||
| ]]> | ||
| </description> | ||
| <version>4.2.0+</version> | ||
| <fields> | ||
| <field> | ||
| <name>system</name> | ||
| <version>4.2.0+</version> | ||
| <description> | ||
| <![CDATA[ | ||
| The name of the quality management system, e.g. {@code SonarQube}. | ||
| ]]> | ||
| </description> | ||
| <type>String</type> | ||
| </field> | ||
| <field> | ||
| <name>url</name> | ||
| <version>4.2.0+</version> | ||
| <description>URL for the quality management system used by the project if it has a web interface.</description> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. delete " if it has a web interface." |
||
| <type>String</type> | ||
| </field> | ||
| </fields> | ||
| <codeSegments> | ||
| <codeSegment> | ||
| <version>4.2.0+</version> | ||
| <code> | ||
| <![CDATA[ | ||
| /** | ||
| * @see java.lang.Object#toString() | ||
| */ | ||
| public String toString() | ||
| { | ||
| return "QualityManagement {system=" + getSystem() + ", url=" + getUrl() + "}"; | ||
| } | ||
| ]]> | ||
| </code> | ||
| </codeSegment> | ||
| </codeSegments> | ||
| </class> | ||
| <class> | ||
| <name>DistributionManagement</name> | ||
| <version>4.0.0+</version> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4921QualityManagementTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
| package org.apache.maven.it; | ||
|
|
||
| import java.nio.file.Path; | ||
| import java.util.Properties; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
|
||
| /** | ||
| * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-4921">MNG-4921</a>. | ||
| * | ||
| * Verifies that the {@code <qualityManagement>} element (POM model 4.2.0) is read from the POM, | ||
| * inherited from the parent and can be overridden by a child. | ||
| */ | ||
| class MavenITmng4921QualityManagementTest extends AbstractMavenIntegrationTestCase { | ||
|
|
||
| MavenITmng4921QualityManagementTest() {} | ||
|
|
||
| /** | ||
| * Verify that the quality management information is read from the effective model, inherited from the parent POM | ||
| * unless overridden by the child. | ||
| * | ||
| * @throws Exception in case of failure | ||
| */ | ||
| @Test | ||
| public void testitQualityManagement() throws Exception { | ||
| Path testDir = extractResources("mng-4921"); | ||
|
|
||
| Verifier verifier = newVerifier(testDir); | ||
| verifier.setAutoclean(false); | ||
| verifier.deleteDirectory("target"); | ||
| verifier.deleteDirectory("inherit/target"); | ||
| verifier.deleteDirectory("override/target"); | ||
| verifier.addCliArgument("validate"); | ||
| verifier.execute(); | ||
| verifier.verifyErrorFreeLog(); | ||
|
|
||
| Properties props = verifier.loadProperties("target/pom.properties"); | ||
| assertEquals("SonarQube", props.getProperty("project.qualityManagement.system")); | ||
| assertEquals("https://sonar.parent.example.org", props.getProperty("project.qualityManagement.url")); | ||
|
|
||
| // child without own qualityManagement inherits it from the parent | ||
| props = verifier.loadProperties("inherit/target/pom.properties"); | ||
| assertEquals("SonarQube", props.getProperty("project.qualityManagement.system")); | ||
| assertEquals("https://sonar.parent.example.org", props.getProperty("project.qualityManagement.url")); | ||
|
|
||
| // child declaring its own qualityManagement overrides the parent's | ||
| props = verifier.loadProperties("override/target/pom.properties"); | ||
| assertEquals("Coverity", props.getProperty("project.qualityManagement.system")); | ||
| assertEquals("https://scan.child.example.org", props.getProperty("project.qualityManagement.url")); | ||
| } | ||
| } |
56 changes: 56 additions & 0 deletions
56
its/core-it-suite/src/test/resources/mng-4921/inherit/pom.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| Licensed to the Apache Software Foundation (ASF) under one | ||
| or more contributor license agreements. See the NOTICE file | ||
| distributed with this work for additional information | ||
| regarding copyright ownership. The ASF licenses this file | ||
| to you under the Apache License, Version 2.0 (the | ||
| "License"); you may not use this file except in compliance | ||
| with the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, | ||
| software distributed under the License is distributed on an | ||
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations | ||
| under the License. | ||
| --> | ||
| <project xmlns="http://maven.apache.org/POM/4.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.2.0 http://maven.apache.org/xsd/maven-4.2.0.xsd"> | ||
| <modelVersion>4.2.0</modelVersion> | ||
| <parent> | ||
| <groupId>org.apache.maven.its.mng4921</groupId> | ||
| <artifactId>mng4921</artifactId> | ||
| </parent> | ||
|
|
||
| <artifactId>mng4921-inherit</artifactId> | ||
| <packaging>jar</packaging> | ||
|
|
||
| <name>Maven Integration Test :: MNG-4921 :: Inherit</name> | ||
| <description>Quality management inherited from parent.</description> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.its.plugins</groupId> | ||
| <artifactId>maven-it-plugin-expression</artifactId> | ||
| <version>2.1-SNAPSHOT</version> | ||
| <executions> | ||
| <execution> | ||
| <goals> | ||
| <goal>eval</goal> | ||
| </goals> | ||
| <phase>validate</phase> | ||
| <configuration> | ||
| <outputFile>target/pom.properties</outputFile> | ||
| <expressions> | ||
| <expression>project</expression> | ||
| </expressions> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> |
61 changes: 61 additions & 0 deletions
61
its/core-it-suite/src/test/resources/mng-4921/override/pom.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| Licensed to the Apache Software Foundation (ASF) under one | ||
| or more contributor license agreements. See the NOTICE file | ||
| distributed with this work for additional information | ||
| regarding copyright ownership. The ASF licenses this file | ||
| to you under the Apache License, Version 2.0 (the | ||
| "License"); you may not use this file except in compliance | ||
| with the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, | ||
| software distributed under the License is distributed on an | ||
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations | ||
| under the License. | ||
| --> | ||
| <project xmlns="http://maven.apache.org/POM/4.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.2.0 http://maven.apache.org/xsd/maven-4.2.0.xsd"> | ||
| <modelVersion>4.2.0</modelVersion> | ||
| <parent> | ||
| <groupId>org.apache.maven.its.mng4921</groupId> | ||
| <artifactId>mng4921</artifactId> | ||
| </parent> | ||
|
|
||
| <artifactId>mng4921-override</artifactId> | ||
| <packaging>jar</packaging> | ||
|
|
||
| <name>Maven Integration Test :: MNG-4921 :: Override</name> | ||
| <description>Quality management overridden by child.</description> | ||
|
|
||
| <qualityManagement> | ||
| <system>Coverity</system> | ||
| <url>https://scan.child.example.org</url> | ||
| </qualityManagement> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.its.plugins</groupId> | ||
| <artifactId>maven-it-plugin-expression</artifactId> | ||
| <version>2.1-SNAPSHOT</version> | ||
| <executions> | ||
| <execution> | ||
| <goals> | ||
| <goal>eval</goal> | ||
| </goals> | ||
| <phase>validate</phase> | ||
| <configuration> | ||
| <outputFile>target/pom.properties</outputFile> | ||
| <expressions> | ||
| <expression>project</expression> | ||
| </expressions> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really should explain what project's quality management information is instead rewriting the name from a camel case variable into prose. As is, I do not know what's expected here.