You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mick Knutson <mi...@gmail.com> on 2007/06/08 22:27:40 UTC

[m2] where to put gen-src so it will get compiles and packaged...???

I have java and xml files being generated and I want to know where to put
them in order for them to be compiled and included into my war?

-- 
---
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/djmick_dot_com
http://www.myspace.com/sexybeotches
http://www.thumpradio.com
---

Re: [m2] where to put gen-src so it will get compiles and packaged...???

Posted by Mick Knutson <mi...@gmail.com>.
A bit further as I have the java files being compiled and added, but not my
xml file:

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>

<source>${basedir}/target/generated-sources</source>
                            </sources>
                            <artifacts>
                              <artifact>
                                <file>*</file>
                                <type>java</type>
                                <classifier>optional</classifier>
                              </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>



I have the following that need to be added to my war:

.\target\generated-sources\BusinessService1-java-wsdl-mapping.xml
.\target\generated-sources\org\delta\services\BusinessService1_PortType.java




On 6/8/07, Mick Knutson <mi...@gmail.com> wrote:
>
> I am trying that, but get an <artifact> error:
>
>
> [0] inside the definition for plugin: 'build-helper-maven-plugin'specify
> the following:
>
> <configuration>
>   ...
>   <artifacts>VALUE</artifacts>
> </configuration>.
>
>
> Here is what I used:
>
>             <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>                 <artifactId>build-helper-maven-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <id>add-source</id>
>                         <phase>generate-sources</phase>
>                         <goals>
>                             <goal>add-source</goal>
>                         </goals>
>                         <configuration>
>                             <sources>
>
> <source>${basedir}/target/generated-sources</source>
>                             </sources>
>                         </configuration>
>                     </execution>
>                 </executions>
>             </plugin>
>
>
>
>
> On 6/8/07, Tom Huybrechts <to...@gmail.com> wrote:
> >
> > Or use the build-helper plugin
> >
> > http://mojo.codehaus.org/build-helper-maven-plugin/howto.html
> >
> > On 6/8/07, Wayne Fay < waynefay@gmail.com> wrote:
> > > You should make a "real" plugin. Its really simple. Then you can use
> > > the "add source root" bit.
> > >
> > > Wayne
> > >
> > > On 6/8/07, Mick Knutson < mickknutson@gmail.com> wrote:
> > > > But all I am doing is calling Oracle's  genInterface via a bat file
> > > >
> > > >
> > > >
> > > >
> > > > On 6/8/07, Jason van Zyl < jason@maven.org> wrote:
> > > > >
> > > > >
> > > > > On 8 Jun 07, at 5:02 PM 8 Jun 07, Mick Knutson wrote:
> > > > >
> > > > > > Well, I added the source to ./target/generated-sources/*
> > > > > >
> > > > >
> > > > > Look at the example I showed you. This will not work and is not
> > > > > recommended. Your plugin that generates the sources must use the
> > > > > reference of the MavenProject and add the resources and sources
> > > > > programmatically. You do not want to make everyone using your
> > plugin
> > > > > have to configure this. Look at the Antlr plugin, which is the way
> > > > > you should be doing it.
> > > > >
> > > > > > With adding the <includes> to my compiler like this:
> > > > > >
> > > > > >            <plugin>
> > > > > >                <groupId>org.apache.maven.plugins </groupId>
> > > > > >                <artifactId>maven-compiler-plugin</artifactId>
> > > > > >                <configuration>
> > > > > >                    <compilerVersion> 1.5</compilerVersion>
> > > > > >                    <source>1.5</source>
> > > > > >                    <target>1.5</target>
> > > > > >                    <debug>${ compiler.debug}</debug>
> > > > > >                    <showDeprecation>${showDeprecation}</
> > > > > > showDeprecation>
> > > > > >                    <showWarnings>${showWarnings}</showWarnings>
> > > > > >                    <optimize>${optimize}</optimize>
> > > > > >
> > > > > >                    <meminitial>${meminitial}</meminitial>
> > > > > >                    <maxmem>${maxmem}</maxmem>
> > > > > >
> > > > > >                    <includes>
> > > > >
> > >                        <include>${basedir}/src/main/java</include>
> > > > >
> > >                        <include>${basedir}/src/test/java</include>
> > > > > >
> > > > > > <include>${basedir}/target/generated-sources</include>
> > > > > >                    </includes>
> > > > > >
> > > > > >                </configuration>
> > > > > >            </plugin>
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > I start getting test compilation errors.
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 6/8/07, Jason van Zyl <ja...@maven.org> wrote:
> > > > > >>
> > > > > >>
> > > > > >> On 8 Jun 07, at 4:27 PM 8 Jun 07, Mick Knutson wrote:
> > > > > >>
> > > > > >> > I have java and xml files being generated and I want to know
> > where
> > > > > >> > to put
> > > > > >> > them in order for them to be compiled and included into my
> > war?
> > > > > >> >
> > > > > >>
> > > > > >> It's not where you put, but telling Maven there are new sources
> > and
> > > > > >> new resources:
> > > > > >>
> > > > > >> From the Antlr plugin:
> > > > > >>
> > > > > >>        if ( project != null )
> > > > > >>          {
> > > > > >>              // Add resources
> > > > > >>              projectHelper.addResource( project,
> > > > > >> outputDirectory.getAbsolutePath(), Collections
> > > > > >>                  .singletonList( "**/**.txt" ), new ArrayList()
> > );
> > > > > >>
> > > > > >>              // Add source root
> > > > > >>             project.addCompileSourceRoot
> > > > > >> ( outputDirectory.getAbsolutePath()
> > > > > >> );
> > > > > >>          }
> > > > > >>
> > > > > >> Reference: http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-
> >
> > > > > >> antlr-plugin/src/main/java/org/apache/maven/plugin/antlr/
> > > > > >> AbstractAntlrMojo.java
> > > > > >>
> > > > > >> Typically you put generated sources in ${
> > project.build.directory}/
> > > > > >> generated-sources/<short-plugin-id>
> > > > > >>
> > > > > >> So for the Antlr plugin this is target/generated-sources/antlr
> > > > > >>
> > > > > >>
> > > > > >> > --
> > > > > >> > ---
> > > > > >> > Thanks,
> > > > > >> > Mick Knutson
> > > > > >> >
> > > > > >> > http://www.baselogic.com
> > > > > >> > http://www.blincmagazine.com
> > > > > >> > http://www.djmick.com
> > > > > >> > http://www.myspace.com/mickknutson
> > > > > >> > http://www.myspace.com/djmick_dot_com
> > > > > >> > http://www.myspace.com/sexybeotches
> > > > > >> > http://www.thumpradio.com
> > > > > >> > ---
> > > > > >>
> > > > > >> Thanks,
> > > > > >>
> > > > > >> Jason
> > > > > >>
> > > > > >> ----------------------------------------------------------
> > > > > >> Jason van Zyl
> > > > > >> Founder and PMC Chair, Apache Maven
> > > > > >> jason at sonatype dot com
> > > > > >> ----------------------------------------------------------
> > > > > >>
> > > > > >>
> > > > > >>
> > > > > >>
> > > > > >>
> > ---------------------------------------------------------------------
> > > > > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > > >> For additional commands, e-mail: users-help@maven.apache.org
> > > > > >>
> > > > > >>
> > > > > >
> > > > > >
> > > > > > --
> > > > > > ---
> > > > > > Thanks,
> > > > > > Mick Knutson
> > > > > >
> > > > > > http://www.baselogic.com
> > > > > > http://www.blincmagazine.com
> > > > > > http://www.djmick.com
> > > > > > http://www.myspace.com/mickknutson
> > > > > > http://www.myspace.com/djmick_dot_com
> > > > > > http://www.myspace.com/sexybeotches
> > > > > > http://www.thumpradio.com
> > > > > > ---
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Jason
> > > > >
> > > > > ----------------------------------------------------------
> > > > > Jason van Zyl
> > > > > Founder and PMC Chair, Apache Maven
> > > > > jason at sonatype dot com
> > > > > ----------------------------------------------------------
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > > For additional commands, e-mail: users-help@maven.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > ---
> > > > Thanks,
> > > > Mick Knutson
> > > >
> > > > http://www.baselogic.com
> > > > http://www.blincmagazine.com
> > > > http://www.djmick.com
> > > > http://www.myspace.com/mickknutson
> > > > http://www.myspace.com/djmick_dot_com
> > > > http://www.myspace.com/sexybeotches
> > > > http://www.thumpradio.com
> > > > ---
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> ---
> Thanks,
> Mick Knutson
>
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/djmick_dot_com
> http://www.myspace.com/sexybeotches
> http://www.thumpradio.com
> ---
>



-- 
---
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/djmick_dot_com
http://www.myspace.com/sexybeotches
http://www.thumpradio.com
---

Re: [m2] where to put gen-src so it will get compiles and packaged...???

Posted by Mick Knutson <mi...@gmail.com>.
I am trying that, but get an <artifact> error:


[0] inside the definition for plugin: 'build-helper-maven-plugin'specify the
following:

<configuration>
  ...
  <artifacts>VALUE</artifacts>
</configuration>.


Here is what I used:

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>

<source>${basedir}/target/generated-sources</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>




On 6/8/07, Tom Huybrechts <to...@gmail.com> wrote:
>
> Or use the build-helper plugin
>
> http://mojo.codehaus.org/build-helper-maven-plugin/howto.html
>
> On 6/8/07, Wayne Fay <wa...@gmail.com> wrote:
> > You should make a "real" plugin. Its really simple. Then you can use
> > the "add source root" bit.
> >
> > Wayne
> >
> > On 6/8/07, Mick Knutson <mi...@gmail.com> wrote:
> > > But all I am doing is calling Oracle's  genInterface via a bat file
> > >
> > >
> > >
> > >
> > > On 6/8/07, Jason van Zyl <ja...@maven.org> wrote:
> > > >
> > > >
> > > > On 8 Jun 07, at 5:02 PM 8 Jun 07, Mick Knutson wrote:
> > > >
> > > > > Well, I added the source to ./target/generated-sources/*
> > > > >
> > > >
> > > > Look at the example I showed you. This will not work and is not
> > > > recommended. Your plugin that generates the sources must use the
> > > > reference of the MavenProject and add the resources and sources
> > > > programmatically. You do not want to make everyone using your plugin
> > > > have to configure this. Look at the Antlr plugin, which is the way
> > > > you should be doing it.
> > > >
> > > > > With adding the <includes> to my compiler like this:
> > > > >
> > > > >            <plugin>
> > > > >                <groupId>org.apache.maven.plugins</groupId>
> > > > >                <artifactId>maven-compiler-plugin</artifactId>
> > > > >                <configuration>
> > > > >                    <compilerVersion>1.5</compilerVersion>
> > > > >                    <source>1.5</source>
> > > > >                    <target>1.5</target>
> > > > >                    <debug>${compiler.debug}</debug>
> > > > >                    <showDeprecation>${showDeprecation}</
> > > > > showDeprecation>
> > > > >                    <showWarnings>${showWarnings}</showWarnings>
> > > > >                    <optimize>${optimize}</optimize>
> > > > >
> > > > >                    <meminitial>${meminitial}</meminitial>
> > > > >                    <maxmem>${maxmem}</maxmem>
> > > > >
> > > > >                    <includes>
> > > > >                        <include>${basedir}/src/main/java</include>
> > > > >                        <include>${basedir}/src/test/java</include>
> > > > >
> > > > > <include>${basedir}/target/generated-sources</include>
> > > > >                    </includes>
> > > > >
> > > > >                </configuration>
> > > > >            </plugin>
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > I start getting test compilation errors.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On 6/8/07, Jason van Zyl <ja...@maven.org> wrote:
> > > > >>
> > > > >>
> > > > >> On 8 Jun 07, at 4:27 PM 8 Jun 07, Mick Knutson wrote:
> > > > >>
> > > > >> > I have java and xml files being generated and I want to know
> where
> > > > >> > to put
> > > > >> > them in order for them to be compiled and included into my war?
> > > > >> >
> > > > >>
> > > > >> It's not where you put, but telling Maven there are new sources
> and
> > > > >> new resources:
> > > > >>
> > > > >> From the Antlr plugin:
> > > > >>
> > > > >>        if ( project != null )
> > > > >>          {
> > > > >>              // Add resources
> > > > >>              projectHelper.addResource( project,
> > > > >> outputDirectory.getAbsolutePath(), Collections
> > > > >>                  .singletonList( "**/**.txt" ), new ArrayList()
> );
> > > > >>
> > > > >>              // Add source root
> > > > >>             project.addCompileSourceRoot
> > > > >> ( outputDirectory.getAbsolutePath()
> > > > >> );
> > > > >>          }
> > > > >>
> > > > >> Reference:
> http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-
> > > > >> antlr-plugin/src/main/java/org/apache/maven/plugin/antlr/
> > > > >> AbstractAntlrMojo.java
> > > > >>
> > > > >> Typically you put generated sources in ${project.build.directory
> }/
> > > > >> generated-sources/<short-plugin-id>
> > > > >>
> > > > >> So for the Antlr plugin this is target/generated-sources/antlr
> > > > >>
> > > > >>
> > > > >> > --
> > > > >> > ---
> > > > >> > Thanks,
> > > > >> > Mick Knutson
> > > > >> >
> > > > >> > http://www.baselogic.com
> > > > >> > http://www.blincmagazine.com
> > > > >> > http://www.djmick.com
> > > > >> > http://www.myspace.com/mickknutson
> > > > >> > http://www.myspace.com/djmick_dot_com
> > > > >> > http://www.myspace.com/sexybeotches
> > > > >> > http://www.thumpradio.com
> > > > >> > ---
> > > > >>
> > > > >> Thanks,
> > > > >>
> > > > >> Jason
> > > > >>
> > > > >> ----------------------------------------------------------
> > > > >> Jason van Zyl
> > > > >> Founder and PMC Chair, Apache Maven
> > > > >> jason at sonatype dot com
> > > > >> ----------------------------------------------------------
> > > > >>
> > > > >>
> > > > >>
> > > > >>
> > > > >>
> ---------------------------------------------------------------------
> > > > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > >> For additional commands, e-mail: users-help@maven.apache.org
> > > > >>
> > > > >>
> > > > >
> > > > >
> > > > > --
> > > > > ---
> > > > > Thanks,
> > > > > Mick Knutson
> > > > >
> > > > > http://www.baselogic.com
> > > > > http://www.blincmagazine.com
> > > > > http://www.djmick.com
> > > > > http://www.myspace.com/mickknutson
> > > > > http://www.myspace.com/djmick_dot_com
> > > > > http://www.myspace.com/sexybeotches
> > > > > http://www.thumpradio.com
> > > > > ---
> > > >
> > > > Thanks,
> > > >
> > > > Jason
> > > >
> > > > ----------------------------------------------------------
> > > > Jason van Zyl
> > > > Founder and PMC Chair, Apache Maven
> > > > jason at sonatype dot com
> > > > ----------------------------------------------------------
> > > >
> > > >
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > ---
> > > Thanks,
> > > Mick Knutson
> > >
> > > http://www.baselogic.com
> > > http://www.blincmagazine.com
> > > http://www.djmick.com
> > > http://www.myspace.com/mickknutson
> > > http://www.myspace.com/djmick_dot_com
> > > http://www.myspace.com/sexybeotches
> > > http://www.thumpradio.com
> > > ---
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
---
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/djmick_dot_com
http://www.myspace.com/sexybeotches
http://www.thumpradio.com
---

Re: [m2] where to put gen-src so it will get compiles and packaged...???

Posted by Jason van Zyl <ja...@maven.org>.
Perfect.

On 8 Jun 07, at 5:46 PM 8 Jun 07, Tom Huybrechts wrote:

> Or use the build-helper plugin
>
> http://mojo.codehaus.org/build-helper-maven-plugin/howto.html
>
> On 6/8/07, Wayne Fay <wa...@gmail.com> wrote:
>> You should make a "real" plugin. Its really simple. Then you can use
>> the "add source root" bit.
>>
>> Wayne
>>
>> On 6/8/07, Mick Knutson <mi...@gmail.com> wrote:
>> > But all I am doing is calling Oracle's  genInterface via a bat file
>> >
>> >
>> >
>> >
>> > On 6/8/07, Jason van Zyl <ja...@maven.org> wrote:
>> > >
>> > >
>> > > On 8 Jun 07, at 5:02 PM 8 Jun 07, Mick Knutson wrote:
>> > >
>> > > > Well, I added the source to ./target/generated-sources/*
>> > > >
>> > >
>> > > Look at the example I showed you. This will not work and is not
>> > > recommended. Your plugin that generates the sources must use the
>> > > reference of the MavenProject and add the resources and sources
>> > > programmatically. You do not want to make everyone using your  
>> plugin
>> > > have to configure this. Look at the Antlr plugin, which is the  
>> way
>> > > you should be doing it.
>> > >
>> > > > With adding the <includes> to my compiler like this:
>> > > >
>> > > >            <plugin>
>> > > >                <groupId>org.apache.maven.plugins</groupId>
>> > > >                <artifactId>maven-compiler-plugin</artifactId>
>> > > >                <configuration>
>> > > >                    <compilerVersion>1.5</compilerVersion>
>> > > >                    <source>1.5</source>
>> > > >                    <target>1.5</target>
>> > > >                    <debug>${compiler.debug}</debug>
>> > > >                    <showDeprecation>${showDeprecation}</
>> > > > showDeprecation>
>> > > >                    <showWarnings>${showWarnings}</showWarnings>
>> > > >                    <optimize>${optimize}</optimize>
>> > > >
>> > > >                    <meminitial>${meminitial}</meminitial>
>> > > >                    <maxmem>${maxmem}</maxmem>
>> > > >
>> > > >                    <includes>
>> > > >                        <include>${basedir}/src/main/java</ 
>> include>
>> > > >                        <include>${basedir}/src/test/java</ 
>> include>
>> > > >
>> > > > <include>${basedir}/target/generated-sources</include>
>> > > >                    </includes>
>> > > >
>> > > >                </configuration>
>> > > >            </plugin>
>> > > >
>> > > >
>> > > >
>> > > >
>> > > > I start getting test compilation errors.
>> > > >
>> > > >
>> > > >
>> > > >
>> > > > On 6/8/07, Jason van Zyl <ja...@maven.org> wrote:
>> > > >>
>> > > >>
>> > > >> On 8 Jun 07, at 4:27 PM 8 Jun 07, Mick Knutson wrote:
>> > > >>
>> > > >> > I have java and xml files being generated and I want to  
>> know where
>> > > >> > to put
>> > > >> > them in order for them to be compiled and included into  
>> my war?
>> > > >> >
>> > > >>
>> > > >> It's not where you put, but telling Maven there are new  
>> sources and
>> > > >> new resources:
>> > > >>
>> > > >> From the Antlr plugin:
>> > > >>
>> > > >>        if ( project != null )
>> > > >>          {
>> > > >>              // Add resources
>> > > >>              projectHelper.addResource( project,
>> > > >> outputDirectory.getAbsolutePath(), Collections
>> > > >>                  .singletonList( "**/**.txt" ), new  
>> ArrayList() );
>> > > >>
>> > > >>              // Add source root
>> > > >>             project.addCompileSourceRoot
>> > > >> ( outputDirectory.getAbsolutePath()
>> > > >> );
>> > > >>          }
>> > > >>
>> > > >> Reference: http://svn.apache.org/repos/asf/maven/plugins/ 
>> trunk/maven-
>> > > >> antlr-plugin/src/main/java/org/apache/maven/plugin/antlr/
>> > > >> AbstractAntlrMojo.java
>> > > >>
>> > > >> Typically you put generated sources in $ 
>> {project.build.directory}/
>> > > >> generated-sources/<short-plugin-id>
>> > > >>
>> > > >> So for the Antlr plugin this is target/generated-sources/antlr
>> > > >>
>> > > >>
>> > > >> > --
>> > > >> > ---
>> > > >> > Thanks,
>> > > >> > Mick Knutson
>> > > >> >
>> > > >> > http://www.baselogic.com
>> > > >> > http://www.blincmagazine.com
>> > > >> > http://www.djmick.com
>> > > >> > http://www.myspace.com/mickknutson
>> > > >> > http://www.myspace.com/djmick_dot_com
>> > > >> > http://www.myspace.com/sexybeotches
>> > > >> > http://www.thumpradio.com
>> > > >> > ---
>> > > >>
>> > > >> Thanks,
>> > > >>
>> > > >> Jason
>> > > >>
>> > > >> ----------------------------------------------------------
>> > > >> Jason van Zyl
>> > > >> Founder and PMC Chair, Apache Maven
>> > > >> jason at sonatype dot com
>> > > >> ----------------------------------------------------------
>> > > >>
>> > > >>
>> > > >>
>> > > >>
>> > > >>  
>> ---------------------------------------------------------------------
>> > > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > > >> For additional commands, e-mail: users-help@maven.apache.org
>> > > >>
>> > > >>
>> > > >
>> > > >
>> > > > --
>> > > > ---
>> > > > Thanks,
>> > > > Mick Knutson
>> > > >
>> > > > http://www.baselogic.com
>> > > > http://www.blincmagazine.com
>> > > > http://www.djmick.com
>> > > > http://www.myspace.com/mickknutson
>> > > > http://www.myspace.com/djmick_dot_com
>> > > > http://www.myspace.com/sexybeotches
>> > > > http://www.thumpradio.com
>> > > > ---
>> > >
>> > > Thanks,
>> > >
>> > > Jason
>> > >
>> > > ----------------------------------------------------------
>> > > Jason van Zyl
>> > > Founder and PMC Chair, Apache Maven
>> > > jason at sonatype dot com
>> > > ----------------------------------------------------------
>> > >
>> > >
>> > >
>> > >
>> > >  
>> ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > > For additional commands, e-mail: users-help@maven.apache.org
>> > >
>> > >
>> >
>> >
>> > --
>> > ---
>> > Thanks,
>> > Mick Knutson
>> >
>> > http://www.baselogic.com
>> > http://www.blincmagazine.com
>> > http://www.djmick.com
>> > http://www.myspace.com/mickknutson
>> > http://www.myspace.com/djmick_dot_com
>> > http://www.myspace.com/sexybeotches
>> > http://www.thumpradio.com
>> > ---
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder and PMC Chair, Apache Maven
jason at sonatype dot com
----------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] where to put gen-src so it will get compiles and packaged...???

Posted by Tom Huybrechts <to...@gmail.com>.
Or use the build-helper plugin

http://mojo.codehaus.org/build-helper-maven-plugin/howto.html

On 6/8/07, Wayne Fay <wa...@gmail.com> wrote:
> You should make a "real" plugin. Its really simple. Then you can use
> the "add source root" bit.
>
> Wayne
>
> On 6/8/07, Mick Knutson <mi...@gmail.com> wrote:
> > But all I am doing is calling Oracle's  genInterface via a bat file
> >
> >
> >
> >
> > On 6/8/07, Jason van Zyl <ja...@maven.org> wrote:
> > >
> > >
> > > On 8 Jun 07, at 5:02 PM 8 Jun 07, Mick Knutson wrote:
> > >
> > > > Well, I added the source to ./target/generated-sources/*
> > > >
> > >
> > > Look at the example I showed you. This will not work and is not
> > > recommended. Your plugin that generates the sources must use the
> > > reference of the MavenProject and add the resources and sources
> > > programmatically. You do not want to make everyone using your plugin
> > > have to configure this. Look at the Antlr plugin, which is the way
> > > you should be doing it.
> > >
> > > > With adding the <includes> to my compiler like this:
> > > >
> > > >            <plugin>
> > > >                <groupId>org.apache.maven.plugins</groupId>
> > > >                <artifactId>maven-compiler-plugin</artifactId>
> > > >                <configuration>
> > > >                    <compilerVersion>1.5</compilerVersion>
> > > >                    <source>1.5</source>
> > > >                    <target>1.5</target>
> > > >                    <debug>${compiler.debug}</debug>
> > > >                    <showDeprecation>${showDeprecation}</
> > > > showDeprecation>
> > > >                    <showWarnings>${showWarnings}</showWarnings>
> > > >                    <optimize>${optimize}</optimize>
> > > >
> > > >                    <meminitial>${meminitial}</meminitial>
> > > >                    <maxmem>${maxmem}</maxmem>
> > > >
> > > >                    <includes>
> > > >                        <include>${basedir}/src/main/java</include>
> > > >                        <include>${basedir}/src/test/java</include>
> > > >
> > > > <include>${basedir}/target/generated-sources</include>
> > > >                    </includes>
> > > >
> > > >                </configuration>
> > > >            </plugin>
> > > >
> > > >
> > > >
> > > >
> > > > I start getting test compilation errors.
> > > >
> > > >
> > > >
> > > >
> > > > On 6/8/07, Jason van Zyl <ja...@maven.org> wrote:
> > > >>
> > > >>
> > > >> On 8 Jun 07, at 4:27 PM 8 Jun 07, Mick Knutson wrote:
> > > >>
> > > >> > I have java and xml files being generated and I want to know where
> > > >> > to put
> > > >> > them in order for them to be compiled and included into my war?
> > > >> >
> > > >>
> > > >> It's not where you put, but telling Maven there are new sources and
> > > >> new resources:
> > > >>
> > > >> From the Antlr plugin:
> > > >>
> > > >>        if ( project != null )
> > > >>          {
> > > >>              // Add resources
> > > >>              projectHelper.addResource( project,
> > > >> outputDirectory.getAbsolutePath(), Collections
> > > >>                  .singletonList( "**/**.txt" ), new ArrayList() );
> > > >>
> > > >>              // Add source root
> > > >>             project.addCompileSourceRoot
> > > >> ( outputDirectory.getAbsolutePath()
> > > >> );
> > > >>          }
> > > >>
> > > >> Reference: http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-
> > > >> antlr-plugin/src/main/java/org/apache/maven/plugin/antlr/
> > > >> AbstractAntlrMojo.java
> > > >>
> > > >> Typically you put generated sources in ${project.build.directory}/
> > > >> generated-sources/<short-plugin-id>
> > > >>
> > > >> So for the Antlr plugin this is target/generated-sources/antlr
> > > >>
> > > >>
> > > >> > --
> > > >> > ---
> > > >> > Thanks,
> > > >> > Mick Knutson
> > > >> >
> > > >> > http://www.baselogic.com
> > > >> > http://www.blincmagazine.com
> > > >> > http://www.djmick.com
> > > >> > http://www.myspace.com/mickknutson
> > > >> > http://www.myspace.com/djmick_dot_com
> > > >> > http://www.myspace.com/sexybeotches
> > > >> > http://www.thumpradio.com
> > > >> > ---
> > > >>
> > > >> Thanks,
> > > >>
> > > >> Jason
> > > >>
> > > >> ----------------------------------------------------------
> > > >> Jason van Zyl
> > > >> Founder and PMC Chair, Apache Maven
> > > >> jason at sonatype dot com
> > > >> ----------------------------------------------------------
> > > >>
> > > >>
> > > >>
> > > >>
> > > >> ---------------------------------------------------------------------
> > > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > >> For additional commands, e-mail: users-help@maven.apache.org
> > > >>
> > > >>
> > > >
> > > >
> > > > --
> > > > ---
> > > > Thanks,
> > > > Mick Knutson
> > > >
> > > > http://www.baselogic.com
> > > > http://www.blincmagazine.com
> > > > http://www.djmick.com
> > > > http://www.myspace.com/mickknutson
> > > > http://www.myspace.com/djmick_dot_com
> > > > http://www.myspace.com/sexybeotches
> > > > http://www.thumpradio.com
> > > > ---
> > >
> > > Thanks,
> > >
> > > Jason
> > >
> > > ----------------------------------------------------------
> > > Jason van Zyl
> > > Founder and PMC Chair, Apache Maven
> > > jason at sonatype dot com
> > > ----------------------------------------------------------
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >
> > --
> > ---
> > Thanks,
> > Mick Knutson
> >
> > http://www.baselogic.com
> > http://www.blincmagazine.com
> > http://www.djmick.com
> > http://www.myspace.com/mickknutson
> > http://www.myspace.com/djmick_dot_com
> > http://www.myspace.com/sexybeotches
> > http://www.thumpradio.com
> > ---
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] where to put gen-src so it will get compiles and packaged...???

Posted by Mick Knutson <mi...@gmail.com>.
if this utility is putting my gen'd source into ./target/generated-source
then why do I need to create a plugin just to have maven compiler pick it
up?


On 6/8/07, Wayne Fay <wa...@gmail.com> wrote:
>
> You should make a "real" plugin. Its really simple. Then you can use
> the "add source root" bit.
>
> Wayne
>
> On 6/8/07, Mick Knutson <mi...@gmail.com> wrote:
> > But all I am doing is calling Oracle's  genInterface via a bat file
> >
> >
> >
> >
> > On 6/8/07, Jason van Zyl <ja...@maven.org> wrote:
> > >
> > >
> > > On 8 Jun 07, at 5:02 PM 8 Jun 07, Mick Knutson wrote:
> > >
> > > > Well, I added the source to ./target/generated-sources/*
> > > >
> > >
> > > Look at the example I showed you. This will not work and is not
> > > recommended. Your plugin that generates the sources must use the
> > > reference of the MavenProject and add the resources and sources
> > > programmatically. You do not want to make everyone using your plugin
> > > have to configure this. Look at the Antlr plugin, which is the way
> > > you should be doing it.
> > >
> > > > With adding the <includes> to my compiler like this:
> > > >
> > > >            <plugin>
> > > >                <groupId>org.apache.maven.plugins</groupId>
> > > >                <artifactId>maven-compiler-plugin</artifactId>
> > > >                <configuration>
> > > >                    <compilerVersion>1.5</compilerVersion>
> > > >                    <source>1.5</source>
> > > >                    <target>1.5</target>
> > > >                    <debug>${compiler.debug}</debug>
> > > >                    <showDeprecation>${showDeprecation}</
> > > > showDeprecation>
> > > >                    <showWarnings>${showWarnings}</showWarnings>
> > > >                    <optimize>${optimize}</optimize>
> > > >
> > > >                    <meminitial>${meminitial}</meminitial>
> > > >                    <maxmem>${maxmem}</maxmem>
> > > >
> > > >                    <includes>
> > > >                        <include>${basedir}/src/main/java</include>
> > > >                        <include>${basedir}/src/test/java</include>
> > > >
> > > > <include>${basedir}/target/generated-sources</include>
> > > >                    </includes>
> > > >
> > > >                </configuration>
> > > >            </plugin>
> > > >
> > > >
> > > >
> > > >
> > > > I start getting test compilation errors.
> > > >
> > > >
> > > >
> > > >
> > > > On 6/8/07, Jason van Zyl <ja...@maven.org> wrote:
> > > >>
> > > >>
> > > >> On 8 Jun 07, at 4:27 PM 8 Jun 07, Mick Knutson wrote:
> > > >>
> > > >> > I have java and xml files being generated and I want to know
> where
> > > >> > to put
> > > >> > them in order for them to be compiled and included into my war?
> > > >> >
> > > >>
> > > >> It's not where you put, but telling Maven there are new sources and
> > > >> new resources:
> > > >>
> > > >> From the Antlr plugin:
> > > >>
> > > >>        if ( project != null )
> > > >>          {
> > > >>              // Add resources
> > > >>              projectHelper.addResource( project,
> > > >> outputDirectory.getAbsolutePath(), Collections
> > > >>                  .singletonList( "**/**.txt" ), new ArrayList() );
> > > >>
> > > >>              // Add source root
> > > >>             project.addCompileSourceRoot
> > > >> ( outputDirectory.getAbsolutePath()
> > > >> );
> > > >>          }
> > > >>
> > > >> Reference:
> http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-
> > > >> antlr-plugin/src/main/java/org/apache/maven/plugin/antlr/
> > > >> AbstractAntlrMojo.java
> > > >>
> > > >> Typically you put generated sources in ${project.build.directory}/
> > > >> generated-sources/<short-plugin-id>
> > > >>
> > > >> So for the Antlr plugin this is target/generated-sources/antlr
> > > >>
> > > >>
> > > >> > --
> > > >> > ---
> > > >> > Thanks,
> > > >> > Mick Knutson
> > > >> >
> > > >> > http://www.baselogic.com
> > > >> > http://www.blincmagazine.com
> > > >> > http://www.djmick.com
> > > >> > http://www.myspace.com/mickknutson
> > > >> > http://www.myspace.com/djmick_dot_com
> > > >> > http://www.myspace.com/sexybeotches
> > > >> > http://www.thumpradio.com
> > > >> > ---
> > > >>
> > > >> Thanks,
> > > >>
> > > >> Jason
> > > >>
> > > >> ----------------------------------------------------------
> > > >> Jason van Zyl
> > > >> Founder and PMC Chair, Apache Maven
> > > >> jason at sonatype dot com
> > > >> ----------------------------------------------------------
> > > >>
> > > >>
> > > >>
> > > >>
> > > >>
> ---------------------------------------------------------------------
> > > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > >> For additional commands, e-mail: users-help@maven.apache.org
> > > >>
> > > >>
> > > >
> > > >
> > > > --
> > > > ---
> > > > Thanks,
> > > > Mick Knutson
> > > >
> > > > http://www.baselogic.com
> > > > http://www.blincmagazine.com
> > > > http://www.djmick.com
> > > > http://www.myspace.com/mickknutson
> > > > http://www.myspace.com/djmick_dot_com
> > > > http://www.myspace.com/sexybeotches
> > > > http://www.thumpradio.com
> > > > ---
> > >
> > > Thanks,
> > >
> > > Jason
> > >
> > > ----------------------------------------------------------
> > > Jason van Zyl
> > > Founder and PMC Chair, Apache Maven
> > > jason at sonatype dot com
> > > ----------------------------------------------------------
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >
> > --
> > ---
> > Thanks,
> > Mick Knutson
> >
> > http://www.baselogic.com
> > http://www.blincmagazine.com
> > http://www.djmick.com
> > http://www.myspace.com/mickknutson
> > http://www.myspace.com/djmick_dot_com
> > http://www.myspace.com/sexybeotches
> > http://www.thumpradio.com
> > ---
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
---
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/djmick_dot_com
http://www.myspace.com/sexybeotches
http://www.thumpradio.com
---

Re: [m2] where to put gen-src so it will get compiles and packaged...???

Posted by Wayne Fay <wa...@gmail.com>.
You should make a "real" plugin. Its really simple. Then you can use
the "add source root" bit.

Wayne

On 6/8/07, Mick Knutson <mi...@gmail.com> wrote:
> But all I am doing is calling Oracle's  genInterface via a bat file
>
>
>
>
> On 6/8/07, Jason van Zyl <ja...@maven.org> wrote:
> >
> >
> > On 8 Jun 07, at 5:02 PM 8 Jun 07, Mick Knutson wrote:
> >
> > > Well, I added the source to ./target/generated-sources/*
> > >
> >
> > Look at the example I showed you. This will not work and is not
> > recommended. Your plugin that generates the sources must use the
> > reference of the MavenProject and add the resources and sources
> > programmatically. You do not want to make everyone using your plugin
> > have to configure this. Look at the Antlr plugin, which is the way
> > you should be doing it.
> >
> > > With adding the <includes> to my compiler like this:
> > >
> > >            <plugin>
> > >                <groupId>org.apache.maven.plugins</groupId>
> > >                <artifactId>maven-compiler-plugin</artifactId>
> > >                <configuration>
> > >                    <compilerVersion>1.5</compilerVersion>
> > >                    <source>1.5</source>
> > >                    <target>1.5</target>
> > >                    <debug>${compiler.debug}</debug>
> > >                    <showDeprecation>${showDeprecation}</
> > > showDeprecation>
> > >                    <showWarnings>${showWarnings}</showWarnings>
> > >                    <optimize>${optimize}</optimize>
> > >
> > >                    <meminitial>${meminitial}</meminitial>
> > >                    <maxmem>${maxmem}</maxmem>
> > >
> > >                    <includes>
> > >                        <include>${basedir}/src/main/java</include>
> > >                        <include>${basedir}/src/test/java</include>
> > >
> > > <include>${basedir}/target/generated-sources</include>
> > >                    </includes>
> > >
> > >                </configuration>
> > >            </plugin>
> > >
> > >
> > >
> > >
> > > I start getting test compilation errors.
> > >
> > >
> > >
> > >
> > > On 6/8/07, Jason van Zyl <ja...@maven.org> wrote:
> > >>
> > >>
> > >> On 8 Jun 07, at 4:27 PM 8 Jun 07, Mick Knutson wrote:
> > >>
> > >> > I have java and xml files being generated and I want to know where
> > >> > to put
> > >> > them in order for them to be compiled and included into my war?
> > >> >
> > >>
> > >> It's not where you put, but telling Maven there are new sources and
> > >> new resources:
> > >>
> > >> From the Antlr plugin:
> > >>
> > >>        if ( project != null )
> > >>          {
> > >>              // Add resources
> > >>              projectHelper.addResource( project,
> > >> outputDirectory.getAbsolutePath(), Collections
> > >>                  .singletonList( "**/**.txt" ), new ArrayList() );
> > >>
> > >>              // Add source root
> > >>             project.addCompileSourceRoot
> > >> ( outputDirectory.getAbsolutePath()
> > >> );
> > >>          }
> > >>
> > >> Reference: http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-
> > >> antlr-plugin/src/main/java/org/apache/maven/plugin/antlr/
> > >> AbstractAntlrMojo.java
> > >>
> > >> Typically you put generated sources in ${project.build.directory}/
> > >> generated-sources/<short-plugin-id>
> > >>
> > >> So for the Antlr plugin this is target/generated-sources/antlr
> > >>
> > >>
> > >> > --
> > >> > ---
> > >> > Thanks,
> > >> > Mick Knutson
> > >> >
> > >> > http://www.baselogic.com
> > >> > http://www.blincmagazine.com
> > >> > http://www.djmick.com
> > >> > http://www.myspace.com/mickknutson
> > >> > http://www.myspace.com/djmick_dot_com
> > >> > http://www.myspace.com/sexybeotches
> > >> > http://www.thumpradio.com
> > >> > ---
> > >>
> > >> Thanks,
> > >>
> > >> Jason
> > >>
> > >> ----------------------------------------------------------
> > >> Jason van Zyl
> > >> Founder and PMC Chair, Apache Maven
> > >> jason at sonatype dot com
> > >> ----------------------------------------------------------
> > >>
> > >>
> > >>
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >> For additional commands, e-mail: users-help@maven.apache.org
> > >>
> > >>
> > >
> > >
> > > --
> > > ---
> > > Thanks,
> > > Mick Knutson
> > >
> > > http://www.baselogic.com
> > > http://www.blincmagazine.com
> > > http://www.djmick.com
> > > http://www.myspace.com/mickknutson
> > > http://www.myspace.com/djmick_dot_com
> > > http://www.myspace.com/sexybeotches
> > > http://www.thumpradio.com
> > > ---
> >
> > Thanks,
> >
> > Jason
> >
> > ----------------------------------------------------------
> > Jason van Zyl
> > Founder and PMC Chair, Apache Maven
> > jason at sonatype dot com
> > ----------------------------------------------------------
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> ---
> Thanks,
> Mick Knutson
>
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/djmick_dot_com
> http://www.myspace.com/sexybeotches
> http://www.thumpradio.com
> ---
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] where to put gen-src so it will get compiles and packaged...???

Posted by Mick Knutson <mi...@gmail.com>.
But all I am doing is calling Oracle's  genInterface via a bat file




On 6/8/07, Jason van Zyl <ja...@maven.org> wrote:
>
>
> On 8 Jun 07, at 5:02 PM 8 Jun 07, Mick Knutson wrote:
>
> > Well, I added the source to ./target/generated-sources/*
> >
>
> Look at the example I showed you. This will not work and is not
> recommended. Your plugin that generates the sources must use the
> reference of the MavenProject and add the resources and sources
> programmatically. You do not want to make everyone using your plugin
> have to configure this. Look at the Antlr plugin, which is the way
> you should be doing it.
>
> > With adding the <includes> to my compiler like this:
> >
> >            <plugin>
> >                <groupId>org.apache.maven.plugins</groupId>
> >                <artifactId>maven-compiler-plugin</artifactId>
> >                <configuration>
> >                    <compilerVersion>1.5</compilerVersion>
> >                    <source>1.5</source>
> >                    <target>1.5</target>
> >                    <debug>${compiler.debug}</debug>
> >                    <showDeprecation>${showDeprecation}</
> > showDeprecation>
> >                    <showWarnings>${showWarnings}</showWarnings>
> >                    <optimize>${optimize}</optimize>
> >
> >                    <meminitial>${meminitial}</meminitial>
> >                    <maxmem>${maxmem}</maxmem>
> >
> >                    <includes>
> >                        <include>${basedir}/src/main/java</include>
> >                        <include>${basedir}/src/test/java</include>
> >
> > <include>${basedir}/target/generated-sources</include>
> >                    </includes>
> >
> >                </configuration>
> >            </plugin>
> >
> >
> >
> >
> > I start getting test compilation errors.
> >
> >
> >
> >
> > On 6/8/07, Jason van Zyl <ja...@maven.org> wrote:
> >>
> >>
> >> On 8 Jun 07, at 4:27 PM 8 Jun 07, Mick Knutson wrote:
> >>
> >> > I have java and xml files being generated and I want to know where
> >> > to put
> >> > them in order for them to be compiled and included into my war?
> >> >
> >>
> >> It's not where you put, but telling Maven there are new sources and
> >> new resources:
> >>
> >> From the Antlr plugin:
> >>
> >>        if ( project != null )
> >>          {
> >>              // Add resources
> >>              projectHelper.addResource( project,
> >> outputDirectory.getAbsolutePath(), Collections
> >>                  .singletonList( "**/**.txt" ), new ArrayList() );
> >>
> >>              // Add source root
> >>             project.addCompileSourceRoot
> >> ( outputDirectory.getAbsolutePath()
> >> );
> >>          }
> >>
> >> Reference: http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-
> >> antlr-plugin/src/main/java/org/apache/maven/plugin/antlr/
> >> AbstractAntlrMojo.java
> >>
> >> Typically you put generated sources in ${project.build.directory}/
> >> generated-sources/<short-plugin-id>
> >>
> >> So for the Antlr plugin this is target/generated-sources/antlr
> >>
> >>
> >> > --
> >> > ---
> >> > Thanks,
> >> > Mick Knutson
> >> >
> >> > http://www.baselogic.com
> >> > http://www.blincmagazine.com
> >> > http://www.djmick.com
> >> > http://www.myspace.com/mickknutson
> >> > http://www.myspace.com/djmick_dot_com
> >> > http://www.myspace.com/sexybeotches
> >> > http://www.thumpradio.com
> >> > ---
> >>
> >> Thanks,
> >>
> >> Jason
> >>
> >> ----------------------------------------------------------
> >> Jason van Zyl
> >> Founder and PMC Chair, Apache Maven
> >> jason at sonatype dot com
> >> ----------------------------------------------------------
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> >
> > --
> > ---
> > Thanks,
> > Mick Knutson
> >
> > http://www.baselogic.com
> > http://www.blincmagazine.com
> > http://www.djmick.com
> > http://www.myspace.com/mickknutson
> > http://www.myspace.com/djmick_dot_com
> > http://www.myspace.com/sexybeotches
> > http://www.thumpradio.com
> > ---
>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder and PMC Chair, Apache Maven
> jason at sonatype dot com
> ----------------------------------------------------------
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
---
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/djmick_dot_com
http://www.myspace.com/sexybeotches
http://www.thumpradio.com
---

Re: [m2] where to put gen-src so it will get compiles and packaged...???

Posted by Jason van Zyl <ja...@maven.org>.
On 8 Jun 07, at 5:02 PM 8 Jun 07, Mick Knutson wrote:

> Well, I added the source to ./target/generated-sources/*
>

Look at the example I showed you. This will not work and is not  
recommended. Your plugin that generates the sources must use the  
reference of the MavenProject and add the resources and sources  
programmatically. You do not want to make everyone using your plugin  
have to configure this. Look at the Antlr plugin, which is the way  
you should be doing it.

> With adding the <includes> to my compiler like this:
>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-compiler-plugin</artifactId>
>                <configuration>
>                    <compilerVersion>1.5</compilerVersion>
>                    <source>1.5</source>
>                    <target>1.5</target>
>                    <debug>${compiler.debug}</debug>
>                    <showDeprecation>${showDeprecation}</ 
> showDeprecation>
>                    <showWarnings>${showWarnings}</showWarnings>
>                    <optimize>${optimize}</optimize>
>
>                    <meminitial>${meminitial}</meminitial>
>                    <maxmem>${maxmem}</maxmem>
>
>                    <includes>
>                        <include>${basedir}/src/main/java</include>
>                        <include>${basedir}/src/test/java</include>
>
> <include>${basedir}/target/generated-sources</include>
>                    </includes>
>
>                </configuration>
>            </plugin>
>
>
>
>
> I start getting test compilation errors.
>
>
>
>
> On 6/8/07, Jason van Zyl <ja...@maven.org> wrote:
>>
>>
>> On 8 Jun 07, at 4:27 PM 8 Jun 07, Mick Knutson wrote:
>>
>> > I have java and xml files being generated and I want to know where
>> > to put
>> > them in order for them to be compiled and included into my war?
>> >
>>
>> It's not where you put, but telling Maven there are new sources and
>> new resources:
>>
>> From the Antlr plugin:
>>
>>        if ( project != null )
>>          {
>>              // Add resources
>>              projectHelper.addResource( project,
>> outputDirectory.getAbsolutePath(), Collections
>>                  .singletonList( "**/**.txt" ), new ArrayList() );
>>
>>              // Add source root
>>             project.addCompileSourceRoot 
>> ( outputDirectory.getAbsolutePath()
>> );
>>          }
>>
>> Reference: http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-
>> antlr-plugin/src/main/java/org/apache/maven/plugin/antlr/
>> AbstractAntlrMojo.java
>>
>> Typically you put generated sources in ${project.build.directory}/
>> generated-sources/<short-plugin-id>
>>
>> So for the Antlr plugin this is target/generated-sources/antlr
>>
>>
>> > --
>> > ---
>> > Thanks,
>> > Mick Knutson
>> >
>> > http://www.baselogic.com
>> > http://www.blincmagazine.com
>> > http://www.djmick.com
>> > http://www.myspace.com/mickknutson
>> > http://www.myspace.com/djmick_dot_com
>> > http://www.myspace.com/sexybeotches
>> > http://www.thumpradio.com
>> > ---
>>
>> Thanks,
>>
>> Jason
>>
>> ----------------------------------------------------------
>> Jason van Zyl
>> Founder and PMC Chair, Apache Maven
>> jason at sonatype dot com
>> ----------------------------------------------------------
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
> -- 
> ---
> Thanks,
> Mick Knutson
>
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/djmick_dot_com
> http://www.myspace.com/sexybeotches
> http://www.thumpradio.com
> ---

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder and PMC Chair, Apache Maven
jason at sonatype dot com
----------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] where to put gen-src so it will get compiles and packaged...???

Posted by Mick Knutson <mi...@gmail.com>.
Well, I added the source to ./target/generated-sources/*

With adding the <includes> to my compiler like this:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerVersion>1.5</compilerVersion>
                    <source>1.5</source>
                    <target>1.5</target>
                    <debug>${compiler.debug}</debug>
                    <showDeprecation>${showDeprecation}</showDeprecation>
                    <showWarnings>${showWarnings}</showWarnings>
                    <optimize>${optimize}</optimize>

                    <meminitial>${meminitial}</meminitial>
                    <maxmem>${maxmem}</maxmem>

                    <includes>
                        <include>${basedir}/src/main/java</include>
                        <include>${basedir}/src/test/java</include>

<include>${basedir}/target/generated-sources</include>
                    </includes>

                </configuration>
            </plugin>




I start getting test compilation errors.




On 6/8/07, Jason van Zyl <ja...@maven.org> wrote:
>
>
> On 8 Jun 07, at 4:27 PM 8 Jun 07, Mick Knutson wrote:
>
> > I have java and xml files being generated and I want to know where
> > to put
> > them in order for them to be compiled and included into my war?
> >
>
> It's not where you put, but telling Maven there are new sources and
> new resources:
>
> From the Antlr plugin:
>
>        if ( project != null )
>          {
>              // Add resources
>              projectHelper.addResource( project,
> outputDirectory.getAbsolutePath(), Collections
>                  .singletonList( "**/**.txt" ), new ArrayList() );
>
>              // Add source root
>             project.addCompileSourceRoot( outputDirectory.getAbsolutePath()
> );
>          }
>
> Reference: http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-
> antlr-plugin/src/main/java/org/apache/maven/plugin/antlr/
> AbstractAntlrMojo.java
>
> Typically you put generated sources in ${project.build.directory}/
> generated-sources/<short-plugin-id>
>
> So for the Antlr plugin this is target/generated-sources/antlr
>
>
> > --
> > ---
> > Thanks,
> > Mick Knutson
> >
> > http://www.baselogic.com
> > http://www.blincmagazine.com
> > http://www.djmick.com
> > http://www.myspace.com/mickknutson
> > http://www.myspace.com/djmick_dot_com
> > http://www.myspace.com/sexybeotches
> > http://www.thumpradio.com
> > ---
>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder and PMC Chair, Apache Maven
> jason at sonatype dot com
> ----------------------------------------------------------
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
---
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/djmick_dot_com
http://www.myspace.com/sexybeotches
http://www.thumpradio.com
---

Re: [m2] where to put gen-src so it will get compiles and packaged...???

Posted by Jason van Zyl <ja...@maven.org>.
On 8 Jun 07, at 4:27 PM 8 Jun 07, Mick Knutson wrote:

> I have java and xml files being generated and I want to know where  
> to put
> them in order for them to be compiled and included into my war?
>

It's not where you put, but telling Maven there are new sources and  
new resources:

 From the Antlr plugin:

       if ( project != null )
         {
             // Add resources
             projectHelper.addResource( project,  
outputDirectory.getAbsolutePath(), Collections
                 .singletonList( "**/**.txt" ), new ArrayList() );

             // Add source root
	    project.addCompileSourceRoot( outputDirectory.getAbsolutePath() );
         }

Reference: http://svn.apache.org/repos/asf/maven/plugins/trunk/maven- 
antlr-plugin/src/main/java/org/apache/maven/plugin/antlr/ 
AbstractAntlrMojo.java

Typically you put generated sources in ${project.build.directory}/ 
generated-sources/<short-plugin-id>

So for the Antlr plugin this is target/generated-sources/antlr


> -- 
> ---
> Thanks,
> Mick Knutson
>
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/djmick_dot_com
> http://www.myspace.com/sexybeotches
> http://www.thumpradio.com
> ---

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder and PMC Chair, Apache Maven
jason at sonatype dot com
----------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org