Skip to content
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

Adds support to -processorpath #95

Merged
merged 1 commit into from
Jun 28, 2021
Merged

Conversation

ulyssesrr
Copy link
Contributor

@ulyssesrr ulyssesrr commented Jun 23, 2021

Libraries like Google AutoValue and MapStruct have split artifacts for the annotations and the actual processor. This approach combined with the "-processorpath" argument avoids pulling unnecessary classes into the runtime classpath, which I believe should be the preferred approach when possible.

This change is JDK8 compatible, as I'm hoping to use it with that version and was mostly adapted from maven-compiler-plugin.

Sample usage:

...
<properties>
    <mapstruct.version>1.4.2.Final</mapstruct.version>
</properties>
...
<dependencies>
    <dependency>
        <groupId>org.mapstruct</groupId>
        <artifactId>mapstruct</artifactId>
        <version>${mapstruct.version}</version>
    </dependency>
</dependencies>
...
<build>
    <plugins>
	<plugin>
		<groupId>org.bsc.maven</groupId>
		<artifactId>maven-processor-plugin</artifactId>
		<version>5.0-jdk8-rc1</version>
		<executions>
			<execution>
				<id>process</id>
				<goals>
					<goal>process</goal>
				</goals>
				<phase>generate-sources</phase>
			</execution>
		</executions>
		<configuration>
			<annotationProcessorPaths>
				<annotationProcessorPath>
					<groupId>org.mapstruct</groupId>
					<artifactId>mapstruct-processor</artifactId>
					<version>${mapstruct.version}</version>
				</annotationProcessorPath>
			</annotationProcessorPaths>
		</configuration>
	</plugin>
    </plugins>
</build>

Thanks for your time.

Ported from maven-compiler-plugin
@bsorrentino
Copy link
Owner

HI @ulyssesrr thanks for contribution

This seems perfectly fit the purpose of this plugin

I'll merge your PR and arrange a new version (5.0) asap

@bsorrentino bsorrentino added this to the 5.0 milestone Jun 27, 2021
bsorrentino pushed a commit that referenced this pull request Jun 28, 2021
bsorrentino pushed a commit that referenced this pull request Jun 28, 2021
bsorrentino pushed a commit that referenced this pull request Jun 28, 2021
bsorrentino added a commit that referenced this pull request Jun 28, 2021
bsorrentino added a commit that referenced this pull request Jun 28, 2021
@bsorrentino bsorrentino merged commit 40c7db8 into bsorrentino:master Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants