question about xml-maven-plugin

View: New views
5 Messages — Rating Filter:   Alert me  

question about xml-maven-plugin

by Ute Platzer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm trying to use the xml-maven-plugin to validate xml-files in a multi-module maven project. It
works fine if I configure the plugin in one of the sub-projects, but it does not work if I configure
it in the common parent pom file: when I build the project in the parent direcotry, it complains
that the xml source directory that I configured is not present in the parent dir (the directory
exists in all sub-modules, but not in the parent).

Is there any way I can use the plugin in this scenario without having to configure it in the pom
files of all the modules?

Thanks for your help, and best regards,

Ute


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: question about xml-maven-plugin

by Mike Power-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If your plugin in your parent pom is not defined in the pluginManagement section I suggest you try moving it there.

From: http://maven.apache.org/pom.html#Plugin_Management
pluginManagement: is an element that is seen along side plugins. Plugin Management contains plugin elements in much the same way, except that rather than configuring plugin information for this particular project build, it is intended to configure project builds that inherit from this one.

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>@@@</groupId>
          <artifactId>@@@</artifactId>
....
        </plugin>
      </plugins>
    </pluginManagement>
  </build>


On Thu, 2009-08-20 at 16:51 +0200, Ute Platzer wrote:
Hi,

I'm trying to use the xml-maven-plugin to validate xml-files in a multi-module maven project. It
works fine if I configure the plugin in one of the sub-projects, but it does not work if I configure
it in the common parent pom file: when I build the project in the parent direcotry, it complains
that the xml source directory that I configured is not present in the parent dir (the directory
exists in all sub-modules, but not in the parent).

Is there any way I can use the plugin in this scenario without having to configure it in the pom
files of all the modules?

Thanks for your help, and best regards,

Ute


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Mike Power

Re: question about xml-maven-plugin

by Ute Platzer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Mike,

thanks for the quick reply!

If I configure the plugin within the pluginManagement section of the parent, it's not automatically
executed in the sub-modules. I have to add it to the plugins section of all the sub-modules' pom
files -- (yes, I do not need to duplicate the configuration, but I still need to specify groupId and
artifactId every time) - my project has > 30 sub-modules, with more to come.

I think this is a general maven problem, that one cannot configure a plugin in a parent pom file for
automatic execution in sub-modules only.

One solution for this case would be to change the xml-maven-plugin so it does not complain if the
xml source directory is not present. Then it wouldn't matter whether it was executed in the parent
or not. Or I could create a dummy directory... hm.

Any other suggestions?

Regards,
  Ute


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: question about xml-maven-plugin

by Mike Power-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No suggestions, I think you have a clear view of the options in front of you.

On Thu, 2009-08-20 at 17:35 +0200, Ute Platzer wrote:
Hi Mike,

thanks for the quick reply!

If I configure the plugin within the pluginManagement section of the parent, it's not automatically 
executed in the sub-modules. I have to add it to the plugins section of all the sub-modules' pom 
files -- (yes, I do not need to duplicate the configuration, but I still need to specify groupId and 
artifactId every time) - my project has > 30 sub-modules, with more to come.

I think this is a general maven problem, that one cannot configure a plugin in a parent pom file for 
automatic execution in sub-modules only.

One solution for this case would be to change the xml-maven-plugin so it does not complain if the 
xml source directory is not present. Then it wouldn't matter whether it was executed in the parent 
or not. Or I could create a dummy directory... hm.

Any other suggestions?

Regards,
  Ute


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Mike Power

Re: question about xml-maven-plugin

by davidkarlsen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 20 Aug 2009, Ute Platzer wrote:

> Hi,
>
> I'm trying to use the xml-maven-plugin to validate xml-files in a
> multi-module maven project. It
> works fine if I configure the plugin in one of the sub-projects, but it does
> not work if I configure
> it in the common parent pom file: when I build the project in the parent
> direcotry, it complains
> that the xml source directory that I configured is not present in the parent
> dir (the directory
> exists in all sub-modules, but not in the parent).
>
> Is there any way I can use the plugin in this scenario without having to
> configure it in the pom
> files of all the modules?
you probably want to configure it in the pluginManagement section,
and refer to it in each submodule.

--
David J. M. Karlsen - +47 90 68 22 43
http://www.davidkarlsen.com
http://mp3.davidkarlsen.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email