Hi Stephen / Roy, I would like to include a LICENSE.txt file as part of the jar (checkstyle-1.0-SNAPSHOT.jar) as listed below.
0 Wed Sep 27 02:05:48 EST 2006 META-INF/ 127 Wed Sep 27 02:05:46 EST 2006 META-INF/MANIFEST.MF 26 Wed Sep 27 02:05:46 EST 2006 LICENSE.txt 433 Wed Sep 27 02:05:46 EST 2006 CheckstyleSuppressions.xml 14230 Wed Sep 27 02:05:46 EST 2006 CustomisedCheckstyle.xml 0 Wed Sep 27 02:05:48 EST 2006 META-INF/maven/ 0 Wed Sep 27 02:05:48 EST 2006 META-INF/maven/customised/ 0 Wed Sep 27 02:05:48 EST 2006 META-INF/maven/customised/checkstyle/ 1310 Wed Sep 27 02:05:40 EST 2006 META-INF/maven/customised/checkstyle/pom.xml 112 Wed Sep 27 02:05:48 EST 2006 META-INF/maven/customised/checkstyle/pom.properties When I reference it within CustomisedCheckstyle.xml as follows it is unable to find it. <module name="Header"> <property name="headerFile" value="LICENSE.txt"/> <property name="ignoreLines" value="1, 2"/> </module> Could you please let me know what I should be putting in the value field to get checkstyle to find it. Thanks Lakshman > -----Original Message----- > From: Lakshman Srilakshmanan > Sent: Wednesday, 20 September 2006 4:23 PM > To: '[EMAIL PROTECTED]' > Subject: RE: Maven+Checkstyle - Configuration file location > > Hi Stephen, > > Thanks, it works well now. > > Lakshman > > -----Original Message----- > > From: Stephen Duncan [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, 20 September 2006 1:48 AM > > To: Maven Users List > > Subject: Re: Maven+Checkstyle - Configuration file location > > > > You need to set up your dependency as an extension, not as a plugin > > dependency. I'm not 100% clear on whether this is because of a bug, > > or if this is how things are intended to be, but it should work if you > > move the dependency and declare it as an extension, like in the > > example a the bottom of this page: > > http://maven.apache.org/plugins/maven-checkstyle-plugin/customize.html > > > > -Stephen > > > > On 9/19/06, Lakshman Srilakshmanan > > <[EMAIL PROTECTED]> wrote: > > > Hi Roy, > > > > > > I was trying to implement the checkstyle configuration as you have done > > > without much success. I was hoping you could help me. > > > > > > I created a project that builds a jar file containing my checkstyle and > > > suppression and installed it in my local repository. The contents of > > > this jar file (checkstyle-1.0-SNAPSHOT.jar) is listed below. > > > > > > 0 Tue Sep 19 14:32:08 EST 2006 META-INF/ > > > 127 Tue Sep 19 14:32:06 EST 2006 META-INF/MANIFEST.MF > > > 433 Tue Sep 19 14:32:06 EST 2006 CheckstyleSuppressions.xml > > > 14161 Tue Sep 19 14:32:06 EST 2006 CustomisedCheckstyle.xml > > > 0 Tue Sep 19 14:32:08 EST 2006 META-INF/maven/ > > > 0 Tue Sep 19 14:32:08 EST 2006 META-INF/maven/customised/ > > > 0 Tue Sep 19 14:32:08 EST 2006 > > > META-INF/maven/customised/checkstyle/ > > > 678 Mon Sep 18 15:03:24 EST 2006 > > > META-INF/maven/customised/checkstyle/pom.xml > > > 112 Tue Sep 19 14:32:06 EST 2006 > > > META-INF/maven/customised/checkstyle/pom.properties > > > > > > > > > > > > I then included the above file under pluginManagement in my POM as > > > follows. > > > > > > <pluginManagement> > > > <plugins> > > > <plugin> > > > <groupId>org.apache.maven.plugins</groupId> > > > <artifactId>maven-checkstyle-plugin</artifactId> > > > <dependencies> > > > <dependency> > > > <groupId>customised.checkstyle</groupId> > > > <artifactId>checkstyle</artifactId> > > > <version>1.0-SNAPSHOT</version> > > > </dependency> > > > </dependencies> > > > </plugin> > > > </pluginManagement> > > > > > > > > > > > > I then included the above definition of the plugin under reports as > > > follows. > > > > > > <reporting> > > > <plugins> > > > <plugin> > > > <artifactId>maven-checkstyle-plugin</artifactId> > > > <configuration> > > > > > > <configLocation>CustomisedCheckstyle.xml</configLocation> > > > > > > <suppressionsLocation>CheckstyleSuppressions.xml</suppressionsLocation> > > > </configuration> > > > </plugin> > > > </plugins> > > > </reporting> > > > > > > > > > When I run mvn clean site I get the following error > > > > > > Embedded error: Error rendering Maven report: Unable to find > > > configuration file location. > > > Unable to find location 'CustomisedCheckstyle.xml' as URL, File or > > > Resource. > > > > > > > > > The funny thing is, when I ran it first I forgot to install the > > > checkstyle-1.0-SNAPSHOT.jar and maven did not complain about not finding > > > the jar file. > > > > > > Not sure what I am doing wrong, but your assistance is greatly > > > appreciated. > > > > > > Thanks > > > Lakshman > > > > > > > > > > -----Original Message----- > > > > From: Roy van der Kuil [mailto:[EMAIL PROTECTED] > > > > Sent: Monday, 4 September 2006 10:10 PM > > > > To: Maven Users List > > > > Subject: Re: Maven+Checkstyle - Configuration file location > > > > > > > > Hi, > > > > > > > > We have a similar setup and have created a 'project' with only a > > > couple of > > > > resources. (our own version of the checkstyle xml and suppressions). > > > > > > > > We deployed this 'jar' and made the maven-checkstyle-plugin dependant > > > on > > > > that dependancy: > > > > <plugin> > > > > <groupId>org.apache.maven.plugins</groupId> > > > > <artifactId>maven-checkstyle-plugin</artifactId> > > > > <dependencies> > > > > <dependency> > > > > <groupId>acompany</groupId> > > > > <artifactId>acompay_style</artifactId> > > > > <version>1.0-SNAPSHOT</version> > > > > </dependency> > > > > </dependencies> > > > > </plugin> > > > > > > > > This actually works very well and makes sure every project uses the > > > 'latest' > > > > style. > > > > > > > > > > > > On 9/4/06, Olivier Vierlinck <[EMAIL PROTECTED]> wrote: > > > > > > > > > > We use maven+checkstyle on a multi-project. > > > > > > > > > > We have defined our checks (mycheckstyle.xml) for one of the > > > component. > > > > > The > > > > > xml file is stored right at the root of the component (next to the > > > src and > > > > > target folders) in the top pom file we have: > > > > > > > > > > <plugin> > > > > > <groupId>org.apache.maven.plugins</groupId> > > > > > <artifactId>maven-checkstyle-plugin</artifactId> > > > > > <configuration> > > > > > <configLocation>mycheckstyle.xml</configLocation> > > > > > </configuration> > > > > > </plugin> > > > > > > > > > > So we have a structure like this > > > > > > > > > > topProject > > > > > --- pom.xml > > > > > > > > > > --- subComponent1 > > > > > --- --- src > > > > > --- --- target > > > > > --- --- pom.xml > > > > > --- --- mycheckstyle.xml > > > > > --- --- ... > > > > > > > > > > --- subComponent2 > > > > > --- --- src > > > > > --- --- target > > > > > --- --- pom.xml > > > > > --- --- ... > > > > > > > > > > --- --- subsubComponent2.1 > > > > > --- --- --- src > > > > > --- --- --- target > > > > > --- --- --- pom.xml > > > > > --- --- --- ... > > > > > > > > > > This works fine. But now, we would like to use the same > > > configuration file > > > > > for ALL our component. So, we would like to have our (single) > > > > > mycheckstyle.xml file stored only once, right under the topProject, > > > next > > > > > to > > > > > the top pom.xml file. > > > > > > > > > > How can we define that in the pom file. I tried using relative path > > > > > (../mycheckstyle.xml), full url (file:../mycheckstyle.xml), using > > > maven > > > > > variables ($project.dir/mycheckstyle.xml) but without success, > > > always with > > > > > one or another error message from maven such as > > > > > > > > > > Unable to find location '../mycheckstyle.xml' as URL, File or > > > Resource. > > > > > > > > > > Is there any way to combine maven's knowledge of the > > > project/components > > > > > tree > > > > > so that each individual component knwos the top level and use it to > > > locate > > > > > the mycheckstyle.xml. Even better: is there a way to support > > > component > > > > > with > > > > > different level in the tree (as subComponent2 and subComponent2.1 in > > > the > > > > > example above) > > > > > > > > > > Thanks, > > > > > Olivier > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > 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] > > > > > > > > > > > > -- > > Stephen Duncan Jr > > www.stephenduncanjr.com > > > > --------------------------------------------------------------------- > > 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]