You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Christian Goetze <cg...@miaow.com> on 2007/03/07 00:24:31 UTC

MultiModule checkstyle config

I've been trying to reproduce the example setup described in
http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html

The example doesn't show me the pom.xml file to be used for the 
"build-tools" module.

I tried making the obvious pom for it with a parent section, I get a 
cyclic reference error.

I tried removing the parent section, but then it fails to actually 
include the build-tools module in the reactor build and bombs out with a 
"failed to resolve artifact".

So, how does it really work ?
--
cg

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


RE: MultiModule checkstyle config

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
>Note how I've set them as dependencies of the plugin. This requires
maven 
>2.0.9 (min) and is what Brian Fox suggested. It basically places them
on 
>the classpath, so I've used the same technique to get them available
for 
>the plugin.

Adding dependencies to the plugin config worked for a while, not just
2.0.9. 2.0.9 is only required if you are trying to override a dependency
that is defined by the plugin author (in the plugin's pom).

>However, adding in this section may work for you, I've commented it out

>for me (it lives in the <build> section):

Using extensions does work but is not the recommended way to do it. This
sticks your jar in the root classpath and can cause troubles (it's
fairly safe if it just has checkstyle config...but I wouldn't do it with
anything else). Extensions are being deprecated in 2.1.

--Brian

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


Re: MultiModule checkstyle config

Posted by Ch...@aami.com.au.
gommo <co...@gmail.com> wrote on 30/05/2008 10:53:48:

> 
> Did you ever solve this? I'm having the same problem

I did, but took a slightly different appoach. It works for me (so far at 
least):

Take this pom:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>au.com.warpspeed</groupId>
        <artifactId>warpspeed-dynamic-parent</artifactId>
        <version>1-SNAPSHOT</version>
    </parent>
    <groupId>au.com.warpspeed</groupId>
    <artifactId>build-tools</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>WarpSpeed Build Tools Extension</name>
    <description>Provides resources to aid the common maven build.</
description>
</project>

I have created this dir structure:

        \src\main\resources\checkstyle-supressions.xml
        \src\main\resources\warpspeed_checkstyle_4_4.xml
        \src\main\resources\warpspeed-header.txt

Use you own content.

Install it into your repo.

And this is what I have in the parent:

    <reporting>
        <plugins>
            <plugin>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin.version}</version>
                <inherited>true</inherited>
                <configuration>
                    <enableRulesSummary>false</enableRulesSummary>
                    <configLocation>${checkstyle.config.location}</
configLocation>
                    <headerLocation>${checkstyle.header.location}</
headerLocation>
                    <!--
                    <headerFile>${checkstyle.header.location}</headerFile>
                    -->
                    <suppressionsLocation>
${checkstyle.suppressions.location}</suppressionsLocation>
                </configuration>
            </plugin>
        </plugins>
    </reporting>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin.version}</version>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <configLocation>${checkstyle.config.location}</
configLocation>
                    <headerLocation>${checkstyle.header.location}</
headerLocation>
                    <suppressionsLocation>
${checkstyle.suppressions.location}</suppressionsLocation>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>au.com.warpspeed</groupId>
                        <artifactId>build-tools</artifactId>
                        <version>${build-tools.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>checkstyle</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>4.4</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>


    <properties>
        <build-tools.version>1.0-SNAPSHOT</build-tools.version>

        <checkstyle.config.location>warpspeed_checkstyle_4_4.xml</
checkstyle.config.location>
        <checkstyle.header.location>warpspeed-header.txt</
checkstyle.header.location>
        <checkstyle.suppressions.location>checkstyle-suppressions.xml</
checkstyle.suppressions.location>
    </properties>


Note how I've set them as dependencies of the plugin. This requires maven 
2.0.9 (min) and is what Brian Fox suggested. It basically places them on 
the classpath, so I've used the same technique to get them available for 
the plugin.

It works for me.

However, adding in this section may work for you, I've commented it out 
for me (it lives in the <build> section):

        <!--
        <extensions>
            <extension>
                <groupId>au.com.warpspeed</groupId>
                <artifactId>build-tools</artifactId>
                <version>${build-tools.version}</version>
            </extension>
        </extensions>
        -->


HTH.

-Chris


**********************************************************************
CAUTION - This message is intended for the addressee named above. It may contain privileged or confidential information. 

If you are not the intended recipient of this message you must: 
- Not use, copy, distribute or disclose it to anyone other than the addressee;
- Notify the sender via return email; and
- Delete the message (and any related attachments) from your computer immediately.

Internet emails are not necessarily secure. Australian Associated Motors Insurers Limited ABN 92 004 791 744 (AAMI), and its related entities, do not accept responsibility for changes made to this message after it was sent.

Unless otherwise stated, views expressed within this email are the author's own and do not represent those of AAMI.
**********************************************************************

Re: MultiModule checkstyle config

Posted by gommo <co...@gmail.com>.
Did you ever solve this? I'm having the same problem

-- 
View this message in context: http://www.nabble.com/MultiModule-checkstyle-config-tp9343576p17549363.html
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