You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Trevor Torrez <ja...@gmail.com> on 2006/11/30 23:34:46 UTC

checkstyles

What is the best way to have all subprojects use the same checkstyles file?

Re: checkstyles

Posted by Mark Hobson <ma...@gmail.com>.
On 04/12/06, Wendy Smoak <ws...@gmail.com> wrote:
> Yep... this is one of those times when Maven is (not so) gently
> encouraging you to do the right thing, (version everything associated
> with your build) even if it seems a bit over the top to have to
> release a jar containing a single file. :)

Can't Jason's remote resources plugin be used for this?

http://people.apache.org/~jvanzyl/maven-remote-resources-plugin/

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: checkstyles

Posted by Mark Hobson <ma...@gmail.com>.
Just been doing this myself and you can use regular plugin
dependencies rather than resorting to extensions.  For example,
putting this in your company-wide parent pom will run checkstyle:check
at the verify phase:

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<configuration>
					<configLocation>checkstyle.xml</configLocation>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>mygroup</groupId>
						<artifactId>mybuild</artifactId>
						<version>1.0</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>

This assumes an artifact mygroup:mybuild:jar:1.0 that contains your
shared checkstyle.xml.

Mark

On 04/12/06, Trevor Torrez <ja...@gmail.com> wrote:
> Yup; i agree; versioning everything associated with the build is a good
> idea, and currently we do do this; I was hoping to get rid of the
> duplications from project to project in an elegent manner; c'est la vie.
>
> The maven-remote-resources plugin, although it would work, doesn't seem
> right either.  After all, I dont want to package the checkstyles.xml file
> with anything, it doesnt really get distributed; so thats a no.
>
>
> On 12/4/06, Wendy Smoak <ws...@gmail.com> wrote:
> >
> > On 12/4/06, Trevor Torrez <ja...@gmail.com> wrote:
> >
> > > Thanks; I had thought about that, I was hoping there was something
> > simpler
> > > and just as transparent.  It kinda grates me to create a maven project
> > and
> > > repository jar file for one file; using a simple URL is tempting, but
> > > anywhere we can stick the file we can stick the jar, and the simple URL
> > idea
> > > doesnt let us control changes to it;
> >
> > Yep... this is one of those times when Maven is (not so) gently
> > encouraging you to do the right thing, (version everything associated
> > with your build) even if it seems a bit over the top to have to
> > release a jar containing a single file. :)
> >
> > --
> > Wendy
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: checkstyles

Posted by Trevor Torrez <ja...@gmail.com>.
Yup; i agree; versioning everything associated with the build is a good
idea, and currently we do do this; I was hoping to get rid of the
duplications from project to project in an elegent manner; c'est la vie.

The maven-remote-resources plugin, although it would work, doesn't seem
right either.  After all, I dont want to package the checkstyles.xml file
with anything, it doesnt really get distributed; so thats a no.


On 12/4/06, Wendy Smoak <ws...@gmail.com> wrote:
>
> On 12/4/06, Trevor Torrez <ja...@gmail.com> wrote:
>
> > Thanks; I had thought about that, I was hoping there was something
> simpler
> > and just as transparent.  It kinda grates me to create a maven project
> and
> > repository jar file for one file; using a simple URL is tempting, but
> > anywhere we can stick the file we can stick the jar, and the simple URL
> idea
> > doesnt let us control changes to it;
>
> Yep... this is one of those times when Maven is (not so) gently
> encouraging you to do the right thing, (version everything associated
> with your build) even if it seems a bit over the top to have to
> release a jar containing a single file. :)
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: checkstyles

Posted by Wendy Smoak <ws...@gmail.com>.
On 12/4/06, Trevor Torrez <ja...@gmail.com> wrote:

> Thanks; I had thought about that, I was hoping there was something simpler
> and just as transparent.  It kinda grates me to create a maven project and
> repository jar file for one file; using a simple URL is tempting, but
> anywhere we can stick the file we can stick the jar, and the simple URL idea
> doesnt let us control changes to it;

Yep... this is one of those times when Maven is (not so) gently
encouraging you to do the right thing, (version everything associated
with your build) even if it seems a bit over the top to have to
release a jar containing a single file. :)

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: checkstyles

Posted by Trevor Torrez <ja...@gmail.com>.
Thanks; I had thought about that, I was hoping there was something simpler
and just as transparent.  It kinda grates me to create a maven project and
repository jar file for one file; using a simple URL is tempting, but
anywhere we can stick the file we can stick the jar, and the simple URL idea
doesnt let us control changes to it;

thanks again

-t.


On 12/2/06, Robert Reiner <rr...@smartics.de> wrote:
>
>
>
> Trevor Torrez wrote:
> >
> > What is the best way to have all subprojects use the same checkstyles
> > file?
> >
> >
>
> Hi Trevor,
>
> I do not know what the best way is, but this is how it works for me:
>
> I have a parent POM to all POMs of my subprojects. In this I declare my
> checkstyle configuration as an extension like this:
>
>   <extensions>
>      <extension>
>        <groupId>de.smartics.config</groupId>
>        <artifactId>checkstyle-config-smartics</artifactId>
>        <version>0.2.1</version>
>      </extension>
>    </extensions>
>
> The plugin is defined in the same POM:
>
>     <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-checkstyle-plugin</artifactId>
>        <version>2.1</version>
>        <extensions>true</extensions>
>        <inherited>true</inherited>
>        <configuration>
>          <configLocation>checkstyle.xml</configLocation>
>        </configuration>
>      </plugin>
>
> The checkstyle project referenced in the extension section is a project on
> its own, containing only the checkstyle.xml. So the build section in this
> project looks like this:
>
> <build>
>    <resources>
>      <resource>
>        <directory>src/main/resources</directory>
>      </resource>
>    </resources>
> </build>
>
> And in the resources directory I place the checkstyle.xml file. I had some
> difficulties placing it in a subdir and naming it other than this, but
> this
> may have been a fault on my side...
>
> Hope this helps.
>
> Greetings,
> Robert
> --
> View this message in context:
> http://www.nabble.com/checkstyles-tf2734779s177.html#a7652646
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: checkstyles

Posted by Robert Reiner <rr...@smartics.de>.

Trevor Torrez wrote:
> 
> What is the best way to have all subprojects use the same checkstyles
> file?
> 
> 

Hi Trevor,

I do not know what the best way is, but this is how it works for me:

I have a parent POM to all POMs of my subprojects. In this I declare my
checkstyle configuration as an extension like this:

   <extensions>
      <extension>
        <groupId>de.smartics.config</groupId>
        <artifactId>checkstyle-config-smartics</artifactId>
        <version>0.2.1</version>
      </extension>
    </extensions>

The plugin is defined in the same POM:

     <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.1</version>
        <extensions>true</extensions>
        <inherited>true</inherited>
        <configuration>
          <configLocation>checkstyle.xml</configLocation>
        </configuration>
      </plugin>

The checkstyle project referenced in the extension section is a project on
its own, containing only the checkstyle.xml. So the build section in this
project looks like this:

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
  </build>

And in the resources directory I place the checkstyle.xml file. I had some
difficulties placing it in a subdir and naming it other than this, but this
may have been a fault on my side...

Hope this helps.

Greetings,
  Robert
-- 
View this message in context: http://www.nabble.com/checkstyles-tf2734779s177.html#a7652646
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: checkstyles

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/30/06, Trevor Torrez <ja...@gmail.com> wrote:

> What is the best way to have all subprojects use the same checkstyles file?

Robert's suggestion of using a separate module as a build extension is
preferable.

Another option is to point checkstyle at a URL for its config file.
This has the disadvantage of requiring you to be online to build
(workaround: modify the pom to point at the full path to a local
copy.)

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org