You found a bug in 2.1-SNAPSHOT. The parents must be pom packaging types. If you want to share checkstyle, just bundle it into a jar with assembly, and then you can add that jar as a dependency to your checkstyle config. You don't need to inherit from the checkstyle jar itself, Checkstyle will find the xml on the classpath. I wrote some examples about this here: http://blogs.sonatype.com/people/2008/04/how-to-share-resources-across-proje cts-in-maven/
http://blogs.sonatype.com/people/2008/04/how-to-override-a-plugins-dependenc y-in-maven/ --Brian On 1/20/09 8:03 AM, "kukudas" <[email protected]> wrote: > Hi, > > i have a problem and i hope somebody can help me. I'm kinda new to this > things so maybe my approach is generaly wrong. > > i'm having a parent for example like this: > > <modelVersion>4.0.0</modelVersion> > <groupId>org.test</groupId> > <artifactId>parent</artifactId> > <version>1</version> > <build> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-checkstyle-plugin</artifactId> > <dependencies> > <dependency> > <groupId>${pom.parent.groupId}</groupId> > <artifactId>${pom.parent.artifactId}</artifactId> > <version>${pom.parent.version}</version> > </dependency> > </dependencies> > </plugin> > <reporting> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-checkstyle-plugin</artifactId> > <configuration> > <configLocation>checkstyle.xml</configLocation> > </configuration> > </plugin> > </plugins> > </reporting> > </project> > > And a child like this: > > <parent> > <groupId>org.test</groupId> > <artifactId>parent</artifactId> > <version>1</version> > </parent> > > <modelVersion>4.0.0</modelVersion> > <groupId>org.test</groupId> > <artifactId>child</artifactId> > > When i use Maven 2.0.9 i get the error that parent packaging has to be pom. > But it has to be jar so my child can access the checkstyle.xml which is in > the parent projects resource folder. > With Maven 2.1-SNAPSHOT it works as expected (checkstyle runs with my rules > which are in the parents resource folder). Is there maybe a better way to > solve this or somehow make it work with both versions? I don't want to use > packaging jar, run clean install for my parent and then change it to pom so > that it will work with 2.0.9. > > > Thanks in advance > > kukudas --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
