I agree. You can also manually add the directory as a source directory in
Eclipse. I'd want the IDEs to be able to do this automatically. I don't
want to get into an IDE war on this thread, though. I just used Eclipse as
an example, because I know how that currently works. However, it only works
because of the availability of the build-helper eclipse plugin.
Establishing the convention in the compiler plugin itself might make it
easier to automate the behavior across IDEs without the need for added
plugins.

On Sun, Oct 23, 2016 at 12:56 PM <e...@zusammenkunft.net> wrote:

> Manually marking a directory as source is not what I would define as
> „understands Maven“. Eclipse finds thise directories automatically (if a
> know plugin is used)
>
>
> Gruss
> Bernd
> --
> http://bernd.eckenfels.net
> From Win 10 Mobile
>
> Von: Robert Patrick
> Gesendet: Sonntag, 23. Oktober 2016 18:45
> An: Maven Users List
> Betreff: RE: Maven Compiler Plugin 3.5.1 bug
>
> That's why we use IntelliJ :-)
>
> It understands Maven projects and uses Maven to build them.  In the IDE,
> you simply cancel the exclusion on the target directory and mark the
> appropriate subdirectory(ies) as a generated sources root.   Nothing to do
> on the IDE side.
>
>
> -----Original Message-----
> From: Christopher [mailto:ctubb...@apache.org]
> Sent: Sunday, October 23, 2016 11:42 AM
> To: Maven Users List
> Subject: Re: Maven Compiler Plugin 3.5.1 bug
>
> The build-helper-maven-plugin method has the advantage of having a
> corresponding build-helper plugin in Eclipse, to automatically add the
> generated sources to the project build path in Eclipse (with m2e). If the
> compiler plugin started using one of the directories in /target/ as a
> source directory by default (maybe /target/generated-src/{main,test}/java),
> it might be nice, but at least for me, it'd only really be useful if IDEs
> also followed that behavior. For now, build-helper is required for this to
> work in Eclipse (I don't know about other IDEs). If the compiler plugin did
> this, and IDEs followed suit, I'd think that would be useful.
>
> On Sat, Oct 22, 2016 at 6:50 PM Robert Patrick <robert.patr...@oracle.com>
> wrote:
>
> > Thanks, I am aware of that plugin and have used it before.  It sure
> > seems like the compiler plugin should provide this capability without
> > the need for yet another plugin to fill the functionality gaps...don't
> you think?
> >
> >
> > -----Original Message-----
> > From: Curtis Rueden [mailto:ctrue...@wisc.edu]
> > Sent: Saturday, October 22, 2016 5:48 PM
> > To: Maven Users List
> > Subject: RE: Maven Compiler Plugin 3.5.1 bug
> >
> > You can add source directories using the build-helper-maven-plugin.
> >
> > On Oct 22, 2016 4:39 PM, "Robert Patrick" <robert.patr...@oracle.com>
> > wrote:
> >
> > > I am using the <resources> section of the POM, not my own plugin, to
> > > populate some tokens in a Java source file that we use to get build
> > > information (version, git commit/branch info, build timestamp, etc).
> > >
> > >         <resources>
> > >             <resource>
> > >                 <directory>src/main/resources/templates</directory>
> > >                 <includes>
> > >                     <include>*.java</include>
> > >                 </includes>
> > >                 <filtering>true</filtering>
> > >
> > > <targetPath>${project.build.directory}/generated-sources/
> > > annotations</targetPath>
> > >             </resource>
> > >           <resources>
> > >
> > > The documentation claims that the default value for the
> > > generatedSourcesDirectory is this directory so you are saying that
> > > somehow the fact that the maven-compiler-plugin no longer includes
> > > the directory in the build is a feature?
> > >
> > > I looked through the compiler plugin's documentation and couldn't
> > > figure out a way to add a directory to the build.  I know how to add
> > > the directory to the build if I write my own plugin but that seems
> > > pretty heavy-handed for something that should be trivial.  What am I
> > missing?
> > >
> > >
> > > -----Original Message-----
> > > From: Thomas Broyer [mailto:t.bro...@gmail.com]
> > > Sent: Saturday, October 22, 2016 4:29 PM
> > > To: Maven Users List
> > > Subject: Re: Maven Compiler Plugin 3.5.1 bug
> > >
> > > This is not a bug, it's a bug fix! Bug introduced in 3.2, fixed in
> > > 3.5.1 (see release notes for that version).
> > >
> > > Your plugin should use its own output directory and add it as a
> > > source root.
> > >
> > > Le sam. 22 oct. 2016 23:18, Robert Patrick
> > > <robert.patr...@oracle.com> a écrit :
> > >
> > > > Periodically, I update the versions of the Maven plugins for my
> > projects.
> > > > Today was one of those days.  What I found is that the
> > > > maven-compiler-plugin 3.5.1's compile goal no longer seems to not
> > > > be including the
> > > > ${project.build.directory}/generated-sources/annotations
> > > >
> > > > directory in the compile.
> > > >
> > > >
> > > >
> > > > My project generates a Java file in the process-resources phase
> > > > and puts the file in this directory.  Other files in the normal
> > > > src/main/java location include/depend on this generated file.
> > > > When I run my build with 3.5, it works perfectly.  When I run the
> > > > exact same build with 3.5.1, it fails.
> > > >
> > > >
> > > >
> > > > I logged into my Apache Jira account but the compiler plugin
> > > > project
> > does
> > > > not seem to want to let me create an issue for this.   Is there some
> > sort
> > > > of special permission required to create an issue on the
> > > > maven-compiler-plugin?
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > > For additional commands, e-mail: users-h...@maven.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>
>

Reply via email to