ci.maven icon indicating copy to clipboard operation
ci.maven copied to clipboard

SVT: Plugin validation issue warning message printed for a plugin not specified in pom.xml

Open hanczaryk opened this issue 2 years ago • 8 comments

SVT: Plugin validation issue warning message printed for a plugin not specified in pom.xml

On my Windows 11 laptop, I've installed IntelliJ 2023.2.3 with the 10/21 liberty-tools-intellij-23.0.7-SNAPSHOT.zip extension from box folder installed. I installed maven 3.9.5 on my laptop.

Under the Liberty view, I expanded my application, MPProShop, selected 'Start' and clicked the green triangle (Liberty : Run Liberty action).

The Liberty server started successfully.

I performed similar actions to stop the server. Under the Liberty view, I expanded my application, MPProShop, selected 'Stop' and clicked the green triangle (Liberty : Run Liberty action).

I was able to successfully stop the server but the terminal printed out some warning messages specifying plugin validation issues for a plugin that isn't referenced in my pom.xml. This might be a valid warning but I'm confused since I never specify maven-resources-plugin:3.3.0.

[INFO] [AUDIT   ] CWWKT0017I: Web application removed (default_host): http://ibm-pw05g47b.raleigh.ibm.com:9080/MPProShop/
[INFO] [AUDIT   ] CWWKZ0009I: The application MPProShop has stopped successfully.
[INFO] [AUDIT   ] CWWKT0016I: Web application available (default_host): http://ibm-pw05g47b.raleigh.ibm.com:9080/MPProShop/
[INFO] [AUDIT   ] CWWKZ0003I: The application MPProShop updated in 1.655 seconds.
q
[INFO] CWWKM2001I: Invoke command is ["C:\Users\XXXXXXXXXX\git\MPProShop\target\liberty\wlp\bin\server.bat", stop, defaultServer].
[INFO] Stopping server defaultServer.
[INFO] [AUDIT   ] CWWKE0055I: Server shutdown requested on Tuesday, October 24, 2023 at 10:07 AM. The server defaultServer is shutting down.
[INFO] [AUDIT   ] CWWKE1100I: Waiting for up to 30 seconds for the server to quiesce.
[INFO] [AUDIT   ] CWWKT0017I: Web application removed (default_host): http://ibm-pw05g47b.raleigh.ibm.com:9080/jwt/
[INFO] [AUDIT   ] CWWKT0017I: Web application removed (default_host): http://ibm-pw05g47b.raleigh.ibm.com:9080/openapi/ui/
[INFO] [AUDIT   ] CWWKT0017I: Web application removed (default_host): http://ibm-pw05g47b.raleigh.ibm.com:9080/metrics/
[INFO] [AUDIT   ] CWWKT0017I: Web application removed (default_host): http://ibm-pw05g47b.raleigh.ibm.com:9080/health/
[INFO] [AUDIT   ] CWWKT0017I: Web application removed (default_host): http://ibm-pw05g47b.raleigh.ibm.com:9080/MPProShop/
[INFO] [AUDIT   ] CWWKT0017I: Web application removed (default_host): http://ibm-pw05g47b.raleigh.ibm.com:9080/ibm/api/
[INFO] [AUDIT   ] CWWKT0017I: Web application removed (default_host): http://ibm-pw05g47b.raleigh.ibm.com:9080/openapi/
[INFO] [AUDIT   ] CWWKZ0009I: The application MPProShop has stopped successfully.
[INFO] [AUDIT   ] CWWKE0036I: The server defaultServer stopped after 5 minutes, 44.319 seconds.
[INFO] Server defaultServer stopped.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  05:50 min
[INFO] Finished at: 2023-10-24T10:07:45-04:00
[INFO] ------------------------------------------------------------------------
[WARNING]
[WARNING] Plugin validation issues were detected in 1 plugin(s)
[WARNING]
[WARNING]  * org.apache.maven.plugins:maven-resources-plugin:3.3.0
[WARNING]
[WARNING] For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE]
[WARNING]

Here are my pom.xml contents.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>MPProShop</groupId>
  <artifactId>MPProShop</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  <name>MPProShop</name>
  <description>MPProShop</description>
  
    <build>
     <resources>
      <resource>
       <directory>src/main/java</directory>
       <includes>
        <include>**/*.java</include>
       </includes>
      </resource>
      <resource>
       <directory>src/main/resources</directory>
       <includes>
        <include>**/*.xml</include>
       </includes>
      </resource>
     </resources>
                  
    <finalName>${project.artifactId}</finalName> 
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.11.0</version>
        <configuration>
          <source>17</source>
          <target>17</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.4.0</version>
        <configuration>
			<outputFileNameMapping>@{artifactId}@.@{extension}@</outputFileNameMapping>
        </configuration>
      </plugin>
      <plugin>
       <groupId>io.openliberty.tools</groupId>
       <artifactId>liberty-maven-plugin</artifactId>
       <version>3.9</version>
      </plugin>      
    </plugins>
  </build>
  
  <repositories>
   <repository>
    <id>maven2</id>
    <name>maven2</name>
    <url>http://repo1.maven.org/maven2</url>
   </repository>
  </repositories>  

  <dependencies>
   	<dependency>
  	 <groupId>jakarta.platform</groupId>
  	 <artifactId>jakarta.jakartaee-api</artifactId>
  	 <version>10.0.0</version>
  	 <scope>provided</scope>
  	</dependency>          	
    <dependency>
     <groupId>org.eclipse.microprofile</groupId>
     <artifactId>microprofile</artifactId>
     <version>6.0</version>
     <type>pom</type>
    </dependency>
    <dependency>
     <groupId>org.apache.commons</groupId>
     <artifactId>commons-lang3</artifactId>
     <version>3.10</version>
    </dependency>
  </dependencies>
  
</project>

I ran a similar test with this same application using VSCode that didn't print these warning messages. I only observed these warning messages in IntelliJ terminal.

hanczaryk avatar Oct 24 '23 14:10 hanczaryk

The Maven plugin warnings have to do with using a Maven 3.9.x version. These warnings get printed by default now and will show plugins that you did not configure directly, but are transitively pulled in. The intent is to make plugin owners aware of potential issues for the upcoming Maven 4.0 release I believe. This is not a Liberty Tools issue.

cherylking avatar Oct 24 '23 15:10 cherylking

Thanks for the clarification. Is there a reason these warning were printed when I used IntelliJ but not when I used VSCode, even though both used Maven 3.9.x ?

hanczaryk avatar Oct 24 '23 16:10 hanczaryk

I would expect it for all three IDEs. Perhaps IntelliJ uses a different default level of logging? But I do see some of those types of warnings in VS Code in the terminal window.

Image

Update: This happened with Maven 3.9.2, but not with 3.9.5 for me.

cherylking avatar Oct 24 '23 17:10 cherylking

I'm going to move this to the repo for LMP and see what if anything we can do to get rid of these warnings. Some of them can be pulled in by plugin configuration in your pom.xml besides the liberty-maven-plugin though.

cherylking avatar Oct 24 '23 20:10 cherylking

@hanczaryk Can you verify that the terminal window in IntelliJ is actually using Maven 3.9.5? I just tried one of my projects locally, and with 3.9.5 those plugin validation warnings went away. You can verify the version by specifying -V after the mvn command.

cherylking avatar Oct 24 '23 21:10 cherylking

From my Windows CMD window and from the IntelliJ terminal mvn -v returned the following showing 3.9.5.

C:\Users\XXXXXX\git\MPProShop>mvn -v
Failed to load native library:jansi.dll. osinfo: Windows/x86_64
java.lang.UnsatisfiedLinkError: Failed to load library "C:\maven\apache-maven-3.9.5\lib\jansi-native\Windows\x86_64\jansi.dll"
Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546)
Maven home: C:\maven\apache-maven-3.9.5
Java version: 17.0.6, vendor: IBM Corporation, runtime: C:\java17
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"

If I attempt to execute 'mvn -v' command from a PowerShell window, I observe the following Access is denied message.

PS C:\Users\XXXXXXXXX> mvn -v
Program 'mvn.cmd' failed to run: Access is deniedAt line:1 char:1
+ mvn -v
+ ~~~~~~.
At line:1 char:1
+ mvn -v
+ ~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed

I don't know if that is having any impact on the warning.

hanczaryk avatar Oct 25 '23 11:10 hanczaryk

@hanczaryk Was that in the same IntelliJ terminal window that Liberty Tools ran the mvn command? That access denied message is the same as you got in your other issue in VS Code related to Powershell vs CMD.

cherylking avatar Oct 25 '23 12:10 cherylking

The IntelliJ terminal window shows the valid 3.9.5 output that I pasted above. The access denied message was only when I attempted to execute in a separate PowerShell window not related to IntelliJ. I just wanted to mention that it seems to be an issue with my PowerShell.

hanczaryk avatar Oct 25 '23 12:10 hanczaryk