Hi

to just exclude a set of files from compulation I used:

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/idl/*Factory.java</exclude>
                    </excludes>
                </configuration>
            </plugin>

        </plugins>
    </build> 


if you want to filter your source files, for instance to inject
the pom.version into it, you can use:

    <build>
        <sourceDirectory>target/generated-sources/filter</sourceDirectory>
        <resources>
            <resource>
                <targetPath>../generated-sources/filter</targetPath>
                <filtering>true</filtering>
                <directory>${basedir}/src/main/java</directory>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>        

            <resource>
                <directory>${basedir}/src/main/resources</directory>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>        
        </resources>
    </build>

the latter filters all files in src/main/java and adds all files in 
src/main/resources

Regards
Mark Donszelmann


-----Original Message-----
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 10, 2005 11:07 PM
To: Maven Users List
Subject: Re: source modifications?

From: "Brett Porter" <[EMAIL PROTECTED]>

>> is the preferred way of doing <sourceModification> from maven 1 in 
>> maven
>> 2 to use filtering
>> on the source files and compile the target? Or is there a different
>> (better) method.

> I believe these would be achieved by profiles in m2.

Is there an example with profiles anywhere yet?  I was using 
<sourceModification> to exclude some files from compilation and I don't see how 
to do it in m2.

Specifically, there are files in certain packages that I need to exclude.
This is an Ant build with files for four artifacts under a single source 
directory.  I have the build files in a separate directory structure so that 
each artifact can have its own pom.xml.  In m1, I was doing this:

    <sourceModifications>
      <sourceModification>
        <className>x.y.z.Class</className>
        <!-- doesn't exist, so the excludes always happen-->
        <excludes>
          <exclude>org/apache/shale/spring/**</exclude>
          <exclude>org/apache/shale/tiles/**</exclude>
        </excludes>
      </sourceModification>
    </sourceModifications>

Thanks,
Wendy Smoak



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


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

Reply via email to