You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2022/04/07 19:24:00 UTC

[jira] [Closed] (MCOMPILER-490) Compilation warning when using BOM dependency in pom.xml

     [ https://issues.apache.org/jira/browse/MCOMPILER-490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Osipov closed MCOMPILER-490.
------------------------------------
    Resolution: Information Provided

> Compilation warning when using BOM dependency in pom.xml
> --------------------------------------------------------
>
>                 Key: MCOMPILER-490
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-490
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 3.9.0, 3.10.0, 3.10.1
>            Reporter: Thomas Smith
>            Priority: Minor
>
> When using a BOM dependency in pom.xml with the {{-Xlint:all}} compiler argument, maven-compiler-plugin will show the following compiler warning:
> {code:none}
> [WARNING] [path] Unexpected file on path: <path to .pom file>{code}
> This occurs in maven-compiler-plugin 3.9.0 and later (starting with [this commit|https://github.com/apache/maven-compiler-plugin/commit/f17b9e2d9d0c89b76fb5e8f980529534c0c109f6#diff-770d75eb3f1634cb819ccb05b6462d37376807e2170d5b9f415992fd0746f12c]).
> It seems to be happening because maven-compiler-plugin is including .pom files for these dependencies in the {{{}$CLASSPATH{}}}.
> Here is a pom.xml that reproduces the issue:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <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>com.example</groupId>
>   <artifactId>main</artifactId>
>   <version>1.0</version>
>   <name>main</name>
>   <properties>
>     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>     <maven.compiler.release>17</maven.compiler.release>
>   </properties>
>   <dependencies>
>     <dependency>
>       <groupId>com.fasterxml.jackson</groupId>
>       <artifactId>jackson-bom</artifactId>
>       <version>2.13.2.1</version>
>       <type>pom</type>
>     </dependency>
>   </dependencies>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <version>3.9.0</version>
>         <configuration>
>           <fork>true</fork>
>           <compilerArgs>
>             <arg>-Xlint:all</arg>
>           </compilerArgs>
>           <showWarnings>true</showWarnings>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
> </project>
> {code}
> Here's my output of {{{}mvn --version{}}}:
> {code:none}
> Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)
> Maven home: /Users/***/.asdf/installs/maven/3.8.3
> Java version: 17.0.1, vendor: Oracle Corporation, runtime: /Users/***/.asdf/installs/java/openjdk-17.0.1
> Default locale: en_US, platform encoding: UTF-8
> OS name: "mac os x", version: "12.3.1", arch: "x86_64", family: "mac"
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)