Skip to content

Commit 0771b61

Browse files
authored
[MGPG-110] SignAndDeployFileMojo validation is off (#78)
It was validating POMs as "Maven2". These POMs should be handled as "new projects" and they must have strict validation in effect instead. Still, given "strict" validation is a moving target (it depends on currently running Maven version), we need to factor in Maven4 as well. Once beta, Maven4 should be added to build matrix. Currently was running locally the build with latest alpha-13 SNAPSHOT (it went OK) that showed one IT that was sensitive to it, fixed in this PR as well. --- https://issues.apache.org/jira/browse/MGPG-110
1 parent 23b64f2 commit 0771b61

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/it/sign-release-with-excludes/verify.groovy

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ var expectedFiles = [
3030

3131
for (File file : artifactDir.listFiles()) {
3232
var fileName = file.getName()
33+
34+
//maven4: skip consumer POM
35+
if (fileName.endsWith("consumer.pom") || fileName.endsWith("consumer.pom.asc")) {
36+
continue
37+
}
38+
3339
println "Checking if file is expected: $file"
3440

3541
var expected = false;

src/main/java/org/apache/maven/plugins/gpg/SignAndDeployFileMojo.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ private void validateArtifactInformation() throws MojoFailureException {
456456
Model model = generateModel();
457457

458458
ModelBuildingRequest request =
459-
new DefaultModelBuildingRequest().setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0);
459+
new DefaultModelBuildingRequest().setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_STRICT);
460460

461461
List<String> result = new ArrayList<>();
462462

0 commit comments

Comments
 (0)