Newbie here.  We have a checkstyle config file that we would like for
all modules within the project hierarchy to use.  Our plan was to store
the config file in a 'buildtools' subdirectory at the top of the project
hierarchy and reference it from the top-level pom.xml file as such:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-checkstyle-plugin</artifactId>
    <configuration>  
        <configLocation>./buildtools/checkstyle.xml</configLocation>
    </configuration>
</plugin>

The problem is that I don't know how to specify the path so that it is
always computed correctly for the current level of the hierarchy.  That
is, this setup only works for the top-level POM, while the
<configLocation> path is wrong for the lower-level ones.  I tried using
the ${basedir} variable, but the value of it changes depending upon the
level of the hierarchy.  What I would like is a variable with a value of
the relative path to the top-level directory.

The only way we've been able to get this to work is to store the file in
our internal repository and reference by an absolute url as such:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-checkstyle-plugin</artifactId>
    <configuration>
<configLocation>http://mavenrepo:8080/internal/checkstyle/checkstyle.xml
</configLocation>
    </configuration>
</plugin>

But, I would rather manage this config file in the source control
system.  Of course this problem is not unique to checkstyle as the same
issue exists for any file that needs to be shared across the hierarchy.
Is there a way compute a variable to contain the value of the path
relative to the top-level pom directory?  Or is there a better way to
achieve what I'm trying to do?

Thanks,

Tim


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to