I have an idea to include an immutable (performs compile-time code generation of POJO) library into a legacy project. The main issue: the legacy project is used widely in other applications, so I do not want to have any new dependency at all. I found that question where it said it is possible to use tag annotationProcessorPaths
for that purpose. I try to rework my config that way:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>17</source>
<target>17</target>
<encoding>UTF-8</encoding>
<showWarnings>true</showWarnings>
<annotationProcessorPaths>
<annotationProcessorPath>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
<version>2.9.2</version>
</annotationProcessorPath>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</pluginManagement>
it does not work. I get an error: Could not find artifact org.immutables:value:jar:unknown
in case I add the library in dependency section - it works. As figure out later, looks like annotationProcessorPaths tag is just order of using annotation processors, but does not actually provide dependencies for them. Is it correct understanding? Is there any work around to use that annotation process without including it in dependency section at all?