Skip to content

[Maven 4] New way of declaring annotation processors cannot find dependencies #323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
PinkMoustacheMan opened this issue Apr 5, 2025 · 2 comments · Fixed by apache/maven#2239
Assignees
Labels
bug Something isn't working

Comments

@PinkMoustacheMan
Copy link

Affected version

4.0.0-beta-2

Bug description

I am using Maven 4 RC-2.

Since declaring annotation processor dependencies using annotationProcessorPaths is deprecated in Maven 4, I tried to do as the deprecation warning suggested.

[WARNING]  Parameter 'annotationProcessorPaths' is deprecated: Replaced by ordinary dependencies with <type> element set to proc, classpath-proc or modular-proc.

So I declared the dependency as follows

<dependencies>
      <dependency>
          <groupId>org.mapstruct</groupId>
          <artifactId>mapstruct-processor</artifactId>
          <version>${version.mapstruct}</version>
          <type>proc</type>
      </dependency>
</dependencies>

But that then led to this error when trying to fetch the dependencies:

Could not find artifact org.mapstruct:mapstruct-processor:proc:1.6.3 in central (https://repo.maven.apache.org/maven2)

I have also tried to use <type>processor</type> instead of <type>proc</type> because I saw that the Type Enum declared it as such, but that led to the same error.

@desruisseaux
Copy link
Contributor

Hello @PinkMoustacheMan . This is actually an issue in Maven core. I just submitted apache/maven#2239 for that. If merged, it would be fixed in Maven 4 RC-4.

Meanwhile, as you already figured out, the proc in the compiler documentation should be processor. I will fix the documentation.

desruisseaux added a commit to Geomatys/maven-compiler-plugin that referenced this issue Apr 6, 2025
desruisseaux added a commit to Geomatys/maven-compiler-plugin that referenced this issue Apr 6, 2025
@PinkMoustacheMan
Copy link
Author

Wonderful, thanks for the quick response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants