Skip to content

Commit

Permalink
[MPLUGIN-452] Maven scope and module name logs at wrong level (#190)
Browse files Browse the repository at this point in the history
Should be logged at WARN level, and not ERROR level. When Mojo logs ERROR, it is expected that it fails the build. And this also confuses the Verifier.

---

https://issues.apache.org/jira/browse/MPLUGIN-452
  • Loading branch information
cstamas committed Jan 12, 2023
1 parent 0f2c0d5 commit 17aabcc
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public void generate()
&& project.getArtifactId().toLowerCase().endsWith( "-plugin" )
&& !"org.apache.maven.plugins".equals( project.getGroupId() ) )
{
getLog().error( LS + LS + "Artifact Ids of the format maven-___-plugin are reserved for" + LS
getLog().warn( LS + LS + "Artifact Ids of the format maven-___-plugin are reserved for" + LS
+ "plugins in the Group Id org.apache.maven.plugins" + LS
+ "Please change your artifactId to the format ___-maven-plugin" + LS
+ "In the future this error will break the build." + LS + LS );
Expand All @@ -270,19 +270,19 @@ public void generate()
Set<Artifact> wrongScopedArtifacts = dependenciesNotInProvidedScope();
if ( !wrongScopedArtifacts.isEmpty() )
{
StringBuilder errorMessage = new StringBuilder(
StringBuilder message = new StringBuilder(
LS + LS + "Some dependencies of Maven Plugins are expected to be in provided scope." + LS
+ "Please make sure that dependencies listed below declared in POM" + LS
+ "have set '<scope>provided</scope>' as well." + LS + LS
+ "The following dependencies are in wrong scope:" + LS
);
for ( Artifact artifact : wrongScopedArtifacts )
{
errorMessage.append( " * " ).append( artifact ).append( LS );
message.append( " * " ).append( artifact ).append( LS );
}
errorMessage.append( LS ).append( LS );
message.append( LS ).append( LS );

getLog().error( errorMessage.toString() );
getLog().warn( message.toString() );
}
}

Expand Down

0 comments on commit 17aabcc

Please sign in to comment.