Open mraible opened 1 year ago
The warning is gone for the first plugin but still exists for Sonar. This seems to be related: https://community.sonarsource.com/t/sonar-maven-plugin-validation-warning/92444
I learned today that you can use -Dmaven.plugin.validation=VERBOSE
to see what's wrong. For example:
./mvnw compile -Dmaven.plugin.validation=VERBOSE
Results in:
[WARNING]
[WARNING] Plugin validation issues were detected in 2 plugin(s)
[WARNING]
[WARNING] * org.jacoco:jacoco-maven-plugin:0.8.10
[WARNING] Declared at location(s):
[WARNING] * ir.bahilla.gateway:bahilla-gateway:0.0.1-SNAPSHOT (pom.xml) @ line 390
[WARNING] Used in module(s):
[WARNING] * ir.bahilla.gateway:bahilla-gateway:0.0.1-SNAPSHOT (pom.xml)
[WARNING] Plugin issue(s):
[WARNING] * Plugin is a Maven 2.x plugin, which will be not supported in Maven 4.x
[WARNING] * Plugin mixes multiple Maven versions: [3.0, 2.0.2]
[WARNING] * Plugin should declare these Maven artifacts in `provided` scope: [org.apache.maven:maven-repository-metadata:3.0, org.apache.maven:maven-artifact:3.0]
[WARNING] * Plugin depends on plexus-container-default, which is EOL
[WARNING]
[WARNING] * org.apache.maven.plugins:maven-resources-plugin:3.3.1
[WARNING] Declared at location(s):
[WARNING] * ir.bahilla.gateway:bahilla-gateway:0.0.1-SNAPSHOT (pom.xml) @ line 374
[WARNING] Used in module(s):
[WARNING] * ir.bahilla.gateway:bahilla-gateway:0.0.1-SNAPSHOT (pom.xml)
[WARNING] Mojo issue(s):
[WARNING] * Mojo resources:resources (org.apache.maven.plugins.resources.ResourcesMojo)
[WARNING] - Parameter 'resources' is read-only, must not be used in configuration
[WARNING]
[WARNING]
[WARNING] Fix reported issues by adjusting plugin configuration or by upgrading above listed plugins. If no upgrade available, please notify plugin maintainers about reported issues.
[WARNING] For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE]
[WARNING]
Hi @mraible @deepu105
The resource plugin warning comes from here: https://github.com/jhipster/generator-jhipster/blob/master/generators/server/templates/pom.xml.ejs#L1392
Because you use the ID default-resources
your configuration for the resource-plugin is also applied to the default resource:resource
mojo attached by default to the process-resources
phase. But unlike resource:copy-resources
which is allowing to configure the resources
parameters (as you did here: https://github.com/jhipster/generator-jhipster/blob/master/generators/server/templates/pom.xml.ejs#L1403C41-L1403C41) the resource:resource
mojo doesn't allow to configure this parameter because it's input is supposed to come from project/build/resources
in the pom.
Now you don't extend anymore by default the spring-boot-parent pom you can probably do something like they do without requiring an additional copy of ressources
...
<build>
<defaultGoal>spring-boot:run</defaultGoal>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/application*.yml</include>
<include>**/application*.yaml</include>
<include>**/application*.properties</include>
<include>config/*.yml</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<excludes>
<exclude>**/application*.yml</exclude>
<exclude>**/application*.yaml</exclude>
<exclude>**/application*.properties</exclude>
<exclude>config/*.yml</exclude>
</excludes>
</resource>
</resources>
...
<pluginManagement>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<propertiesEncoding>${project.build.sourceEncoding}</propertiesEncoding>
<delimiters>
<delimiter>${resource.delimiter}</delimiter>
</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters>
</configuration>
</plugin>
HTH
Thanks for the suggestion, @aheritier! I created https://github.com/jhipster/generator-jhipster/pull/23945 to fix it.
Fixed by #23946.
We probably didn't fix everything here @mraible
Issues about frontend and sonar plugins could be probably solved by upgrading them but I didn't look at them for now.
@aheritier I'll re-open this issue. If I run the following command:
./mvnw compile -Dmaven.plugin.validation=VERBOSE
There is a warning:
[WARNING]
[WARNING] * org.apache.maven.plugins:maven-checkstyle-plugin:3.3.0
[WARNING] Plugin EXTERNAL issue(s):
[WARNING] * Plugin depends on plexus-container-default, which is EOL
JHipster has completed the sample check
.yo-rc.json
: valid
Entities JDL: valid
Application: successfully generated
Frontend check: skipped
Backend check: skipped
E2E check: skipped
I had the same error when building project (mvn -Pprod)
upgrading to maven 3.9.6, these errors disappeared
Overview of the issue
When I create a new project with
blog-oauth2.jdl
(after fixing for v8), there's some warnings about Maven plugins:Motivation for or Use Case
It doesn't look good to have warnings from build files.
Reproduce the error
These warnings happen as part of the app creation process.
JHipster Version(s)
main
branchJHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
Environment and Tools
openjdk version "17.0.5" 2022-10-18 LTS OpenJDK Runtime Environment GraalVM 22.3.0 (build 17.0.5+8-LTS) OpenJDK 64-Bit Server VM GraalVM 22.3.0 (build 17.0.5+8-LTS, mixed mode, sharing)
git version 2.39.2 (Apple Git-143)
node: v18.13.0 npm: 9.6.5
Docker version 23.0.5, build bc4487a
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions