The includes parameter works only on files inside the compileSourceRoots. So if you have compileSourceRoots as "src/main/java" and have include as "src/generated/java" then the compiler searches for "src/main/java/src/generated/java".

Even if you put ${basedir} in the includes, it will still be appended to what's in the compileSourceRoots.

Hope that helps.

^_^



Mykel Alvis wrote:
Thanks!  Like moving the "generated" sources to "src/main", that does
solve my immediate need, but there might be source in the "real"
source directory in the future and that those (pre)generated sources
will eventually get generated in the correct way, I hope.

The question still remains about how to get the <includes> to operate
in the manner that I want.  Maybe there's some other way?

The following also does not work (I added ${basedir} on the chance
that the paths weren't relative):

         <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <configuration>
                   <includes>

<include>${basedir}/src/generated/java/**/*.java</include>
                   </includes>
              </configuration>
          </plugin>


On 6/29/06, Valeri Felberg <[EMAIL PROTECTED]> wrote:
If there are no sources in src/main/java but only in src/generated/java why
don't you set the project source root to src/generated/java like this:
...
<build>
  <sourceDirectory>${basedir}/src/generated/java</sourceDirectory>
  ...
</build>

Kind regards,
Valeri Felberg


On 6/29/06, Mykel Alvis <[EMAIL PROTECTED]> wrote:
>
> I may have misconfigured it, but the
> /home/malvis/code/test-checkout/orm/src/main/java reference comes for
> free,
> since /home/.../orm is the project's base directory.
>
> The sources are ONLY in src/generated/java.  There are no sources in
> src/main/java. The generated sources are generated prior to starting the
> lifecycle, and not produced as a part of the build process at all.
>
> When I move the sources to src/main/java and remove the "<includes>", they
> compile as expected.
>
> If the sources are in src/main/java and I have the <includes> configured,
> it
> finds no sources to compile.
>
> I just can't seem to get it to look in src/generated/java for java files.
>
> Now that I'm away from the office, I thought to try to base my <include>
> on
> the module's project ${basedir} or whatever it is in m2, but that'll have
> to
> wait until tomorrow.
>
> If someone else has done such a thing with success, would you mind posting
> the relevant pom sections?
>
>
>
> On 6/28/06, Edwin Punzalan <[EMAIL PROTECTED]> wrote:
> >
> >
> > I think you misconfigured it.
> >
> > You've set the includes to search only in src/generate/java but it seems
> > like the generated sources are in src/main/java (from
> > /home/malvis/code/test-checkout/orm/src/main/java).
> >
> > Hope that helps.
> >
> >
> > ^_^
> >
> >
> > Mykel Alvis wrote:
> > > Sorry if this is a repeat, but I haven't located an answer on the web
> > > anywhere.
> > > I found http://jira.codehaus.org/browse/MCOMPILER-26 but it appears
> > > closed.
> > >
> > > In the pom of a module, I have included the following:
> > > <build>
> > > <plugins>
> > >            <plugin>
> > >                <groupId>org.apache.maven.plugins</groupId>
> > >                <artifactId>maven-compiler-plugin</artifactId>
> > >                <configuration>
> > >                    <includes>
> > > <include>src/generated/java/**/*.java</include>
> > >                    </includes>
> > >                </configuration>
> > >             </plugin>
> > > </plugins>
> > > </build>
> > >
> > > This particular module has no code to compile in src/main/java.
> > > During a compile,  I get :
> > >
> > > [DEBUG]   (f) compileSourceRoots =
> > > [/home/malvis/code/test-checkout/orm/src/main/java]
> > > [DEBUG]   (f) compilerId = javac
> > > [DEBUG]   (f) debug = true
> > > [DEBUG]   (f) fork = false
> > > [DEBUG]   (f) includes = [src/generated/java/**/*.java]
> > > [DEBUG]   (f) optimize = false
> > > [DEBUG]   (f) outputDirectory =
> > > /home/malvis/code/test-checkout/orm/target/classes
> > > .
> > > .
> > > .
> > > [DEBUG] Output directory:
> > > /home/malvis/code/test-checkout/orm/target/classes
> > > [INFO] Nothing to compile - all classes are up to date
> > > [INFO]
> > >
> ------------------------------------------------------------------------
> > > [INFO] BUILD SUCCESSFUL
> > > [INFO]
> > >
> ------------------------------------------------------------------------
> > > [INFO] Total time: 2 seconds
> > >
> > > Why would the compiler not recognize the need to compile the included
> > > sources?
> > > Is this a continuing compiler problem or am I configuring it wrong?
> > >
> > > Thanks,
> > > Mykel
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
>
> Never wear anything that panics the cat. -- P. J. O'Rourke
>
>





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to