developing maven plugin, how to exclude bitkeeper files

Posted by Denali on Stack Overflow See other posts from Stack Overflow or by Denali
Published on 2010-03-13T00:58:25Z Indexed on 2010/03/13 1:27 UTC
Read the original article Hit count: 365

Filed under:

Hi There,

I am trying to write my first maven plugin. I'd like to exclude all the java files related to the source repository I'm using, which is BitKeeper. These files live in directories called SCCS. I can't for the life of me figure out how to do this. When I add the maven-compile-plugin with excludes data, it works (the bk files are excluded) if I specify mvn compiler:compile. But this is not binding to the compile phase. So that when I run mvn compile, it blows up trying to compile a source control specific java file. Any help or pointers appreciated.

Another thing to note: Everything works perfectly if I change the packaging from "maven-plugin" to "jar", which of course, I can't do permanently since this is a maven plugin I am trying to write.

I'm sorry if this is answered elsewhere. I've looked around for several hours here and through the maven docs, but everything on this topic seems to be related to writing code which will be packaged in jars, not maven plugins.

Here's my pom.xml:

<project>

<modelVersion>4.0.0</modelVersion>
<groupId>com.mycomp.mygroup</groupId>
<artifactId>special-persistence-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>1.0-SNAPSHOT</version>
<name>Special Persistence Plugin</name>

<dependencies>
  <dependency>
    <groupId>org.apache.maven</groupId>
    <artifactId>maven-plugin-api</artifactId>
    <version>2.0</version>
  </dependency>
</dependencies>

<build>
  <plugins>
    <plugin>
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
        <source>1.6</source>
        <target>1.6</target>
        <encoding>UTF-8</encoding>
        <excludes>
           <exclude>**/SCCS/**/*.java</exclude>
        </excludes>
        <phase>compile</phase>
         <goals>
           <goal>compiler:compile</goal>
         </goals>         
       </configuration>
     </plugin>
  </plugins>
</build>

</project>

Thank you to anyone with ideas about this,

-Denali

© Stack Overflow or respective owner

Related posts about maven-2