maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Broyer (JIRA)" <>
Subject [jira] (MCOMPILER-122) -sourcepath shall include resources
Date Sat, 21 Feb 2015 12:02:19 GMT


Thomas Broyer commented on MCOMPILER-122:

This is a bad idea IMO.

First, annotation processors shouldn't depend on non-java inputs, because JSR-269 doesn't
allow you to track dependencies of generated sources/classes/resources to anything else than
(File#getResource is rather meant to read resources that were previously generated by File#createResource,
but should still be used with care).

Also, including target/classes to sourcepath could lead to classes being compiled or recompiled
when they shouldn't (when you have *.java files as resources but not sources). Fortunately,
there'd be an easy workaround here: exclude *.java files from and
use resources:copy-resources after the compile phase to copy the *.java files; that'd still
be a hack if you ask me.

> -sourcepath shall include resources
> -----------------------------------
>                 Key: MCOMPILER-122
>                 URL:
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Milos Kleint
> annotation processors which load non-Java resources from the sourcepath, will currently
get only the src/main/java folder.
> Unfortunately just adding src/main/resources to -sourcepath does not suffice, due to
a bug in javac:
> see MCOMPILER-98 for more

This message was sent by Atlassian JIRA

View raw message