You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tatiana Escovedo <ta...@gmail.com> on 2006/07/07 00:46:46 UTC

Simple question regarding inheritance

Hi,

I need some advice regarding the correct approach to the simple
inheritance problem as follows.
I have defined a parent and a child project using Maven 2. The parent
project's POM specifies the use of the checkstyle plugin:

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

I.e., the checkstyle configuration file is located at the root of the
parent project. When I try to build the site of the child project, it
fails because Maven can't locate the file. I then decided to use
something like this on the parent POM:

<plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-checkstyle-plugin</artifactId>
     <configuration>
         <configLocation>../path-to-parent-project/my-company-style.xml</configLocation>
     </configuration>
 </plugin>

And it worked, as the parent and child projects are at the same level.
However, this solution isn't satisfatory because it assume the working
directory is the child project's root. When I tried to build the child
project using the above POM under Continuum, the build failed with a
message like "Unable to find location 'my-company-style.xml' as URL,
File or Resource." I believe this happened because Continuum uses a
different working directory.

So, what's the correct approach to refer the checkstyle settings file
at the parent POM level?

Thanks in advance,

-- 
------------------------------
Tatiana Escovedo
tatiana@longadata.com

Longadata
Tecnologia da Informação
------------------------------

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


Re: Simple question regarding inheritance

Posted by Edwin Punzalan <ep...@exist.com>.
This might help: 
http://maven.apache.org/plugins/maven-checkstyle-plugin/tips.html

^_^



Tatiana Escovedo wrote:
> Hi,
>
> I need some advice regarding the correct approach to the simple
> inheritance problem as follows.
> I have defined a parent and a child project using Maven 2. The parent
> project's POM specifies the use of the checkstyle plugin:
>
> <plugin>
>    <groupId>org.apache.maven.plugins</groupId>
>    <artifactId>maven-checkstyle-plugin</artifactId>
>    <configuration>
>        <configLocation>my-company-style.xml</configLocation>
>    </configuration>
> </plugin>
>
> I.e., the checkstyle configuration file is located at the root of the
> parent project. When I try to build the site of the child project, it
> fails because Maven can't locate the file. I then decided to use
> something like this on the parent POM:
>
> <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-checkstyle-plugin</artifactId>
>     <configuration>
>         
> <configLocation>../path-to-parent-project/my-company-style.xml</configLocation> 
>
>     </configuration>
> </plugin>
>
> And it worked, as the parent and child projects are at the same level.
> However, this solution isn't satisfatory because it assume the working
> directory is the child project's root. When I tried to build the child
> project using the above POM under Continuum, the build failed with a
> message like "Unable to find location 'my-company-style.xml' as URL,
> File or Resource." I believe this happened because Continuum uses a
> different working directory.
>
> So, what's the correct approach to refer the checkstyle settings file
> at the parent POM level?
>
> Thanks in advance,
>

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