You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Clifton <cl...@gmail.com> on 2008/07/07 14:42:01 UTC
Add Generated Src to IDE build path?
Hello,
I'm having lots of trouble with a Maven project that generates source. In my
project a crude wiring framework is created from a template and a properties
file creating an Assembler.java class that plugs implementations into
collaborators. This class needs to be on our IDE build path
(Eclipse/IntelliJ) in order for other classes to resolve. Using the Maven
support in these IDEs the build path is naturally managed by Maven, which
takes the resrouces and src folders declared in the POM and puts them on the
build path along with dependency jars. I can manually set an extra build
path entry but that fights the Maven support which undoes my manual entry
when it synchronizes. Maven only seems to allow a single source folder
entry. I had to set low level compiler flags to get the generated folders
included in the compile process. I used
<compilerArguments><sourcepath>target/gensrc</sourcepath></compilerArguments>
as this was the only way I could find to get Maven to build the project. I
also tried sneaking the generated source folder into the resources path to
get it into IDE visibility but since it's under the target folder it is
overridden by the "exclude output folders" setting that Maven support
enables. So my question is how do you properly manage generated source in a
Maven project? Any/all advice is welcome.
--
View this message in context: http://www.nabble.com/Add-Generated-Src-to-IDE-build-path--tp18315813p18315813.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Add Generated Src to IDE build path?
Posted by Eugene Kuleshov <eu...@md.pp.ru>.
You normally don't need build helper plugin, when using properly
implemented Maven plugin. Plugins like jaxb, plexus, and number of others
are automatically adding generated sources to the project. When such project
is imported into the IDE, those implicitly added source folders are
automatically added to the project build path. This is how it is implemented
in m2eclipse [1]. Though if you are using default settings you may have to
run "Maven / Update project configuration" action to pickup generated
folders, or change "goals to run on project import" setting in workbench
Maven preferences to "process-test-classes".
regards,
Eugene
[1] http://m2eclipse.codehaus.org/
Markku Saarela-2 wrote:
>
> Use plugins Build Helper Maven plugins add-source goal in your pom.xml
> that resolves all of those proplems.
>
> http://mojo.codehaus.org/build-helper-maven-plugin/
>
> - markku
>
> Clifton wrote:
>> Hello,
>>
>> I'm having lots of trouble with a Maven project that generates source. In
>> my
>> project a crude wiring framework is created from a template and a
>> properties
>> file creating an Assembler.java class that plugs implementations into
>> collaborators. This class needs to be on our IDE build path
>> (Eclipse/IntelliJ) in order for other classes to resolve. Using the Maven
>> support in these IDEs the build path is naturally managed by Maven, which
>> takes the resrouces and src folders declared in the POM and puts them on
>> the
>> build path along with dependency jars. I can manually set an extra build
>> path entry but that fights the Maven support which undoes my manual entry
>> when it synchronizes. Maven only seems to allow a single source folder
>> entry. I had to set low level compiler flags to get the generated folders
>> included in the compile process. I used
>> <compilerArguments><sourcepath>target/gensrc</sourcepath></compilerArguments>
>> as this was the only way I could find to get Maven to build the project.
>> I
>> also tried sneaking the generated source folder into the resources path
>> to
>> get it into IDE visibility but since it's under the target folder it is
>> overridden by the "exclude output folders" setting that Maven support
>> enables. So my question is how do you properly manage generated source in
>> a
>> Maven project? Any/all advice is welcome.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Add-Generated-Src-to-IDE-build-path--tp18315813p18332902.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Add Generated Src to IDE build path?
Posted by Markku Saarela <ma...@kolumbus.fi>.
Hi,
Use plugins Build Helper Maven plugins add-source goal in your pom.xml
that resolves all of those proplems.
http://mojo.codehaus.org/build-helper-maven-plugin/
- markku
Clifton wrote:
> Hello,
>
> I'm having lots of trouble with a Maven project that generates source. In my
> project a crude wiring framework is created from a template and a properties
> file creating an Assembler.java class that plugs implementations into
> collaborators. This class needs to be on our IDE build path
> (Eclipse/IntelliJ) in order for other classes to resolve. Using the Maven
> support in these IDEs the build path is naturally managed by Maven, which
> takes the resrouces and src folders declared in the POM and puts them on the
> build path along with dependency jars. I can manually set an extra build
> path entry but that fights the Maven support which undoes my manual entry
> when it synchronizes. Maven only seems to allow a single source folder
> entry. I had to set low level compiler flags to get the generated folders
> included in the compile process. I used
> <compilerArguments><sourcepath>target/gensrc</sourcepath></compilerArguments>
> as this was the only way I could find to get Maven to build the project. I
> also tried sneaking the generated source folder into the resources path to
> get it into IDE visibility but since it's under the target folder it is
> overridden by the "exclude output folders" setting that Maven support
> enables. So my question is how do you properly manage generated source in a
> Maven project? Any/all advice is welcome.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org