You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by simon <sk...@apache.org> on 2008/01/04 22:17:17 UTC

buildManagement for reports

Hi,

I would like to define some report configuration in a parent pom, so
that they apply to child modules. In particular, the maven-pmd-plugin
needs some config common to all the submodules. 

But I do not want those reports to actually *run* for the parent; it
makes no sense to have a pmd report in the parent site's reports
section, as the parent project has no code.

For a build plugin, this kind of configuration be done in the
pluginManagement section. But configuring a report plugin in
pluginManagement does not appear to affect reports, and there is no
reportManagement section.

So what is the equivalent for report plugins?

Is it something to do with the reportSets section? I have read the maven
docs on that several times and just don't understand what this is meant
to do..

Thanks,

Simon


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


RE: buildManagement for reports

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Ok, I missed the part about also binding them to the lifecycle. That's
what I didn't try.

-----Original Message-----
From: jallen [mailto:john_h_allen@hotmail.com] 
Sent: Sunday, January 06, 2008 8:21 AM
To: users@maven.apache.org
Subject: RE: buildManagement for reports


Hi Brian,

Yes it works as it's the only way we can get plugin dependencies passed
to
the reporting plugins, (see MNG-1948). Here's the profile we use, it
started
off life doing nothing bar binding the plugins to the build but since
then
we have added our own custom aggregation functionality and so they now
run
goals.

The thing you want to make sure happens is that you see the plugins
being
configured before the site phase of the build, then you should know that
they've been initialised as normal build plugins and should be available
when reporting comes to use them. 

Well that's how understand it :) This all started off life in 2.0.1
days,
core may have moved on such that simply binding them and not running any
mojos may no longer work ...

Hope it helps.

		<!--
============================================================= -->
		<!-- Default settings for plugins used in profiles or
run from -->
		<!-- the command line -->
		<!--
============================================================= -->

		<pluginManagement>

			<plugins>

				<plugin>
	
<groupId>org.apache.maven.plugins</groupId>
	
<artifactId>maven-compiler-plugin</artifactId>
					<configuration>
						<source>1.5</source>
						<target>1.5</target>
					</configuration>
				</plugin>

				<plugin>
	
<groupId>org.apache.maven.plugins</groupId>
	
<artifactId>maven-clover-plugin</artifactId>
					<version>
	
${apt.maven-clover-plugin.version}
					</version>
					<dependencies>
						<dependency>
							<groupId>
	
com.fujitsu.fs.apt.maven.configs
							</groupId>
	
<artifactId>maven-apt-clover-config</artifactId>
							<version>
	
${apt.configs-clover.version}
							</version>
						</dependency>
					</dependencies>
					<configuration>
	
<flushPolicy>threaded</flushPolicy>
						<jdk>1.5</jdk>
	
<flushInterval>100</flushInterval>
	
<targetPercentage>0%</targetPercentage>
						<licenseLocation>
	
clover-fujitsu.license
						</licenseLocation>
					</configuration>
				</plugin>

				<plugin>
	
<groupId>com.fujitsu.fs.apt.maven.plugins</groupId>
	
<artifactId>maven-apt-checkstyle-plugin</artifactId>
					<version>
	
${apt.maven-apt-checkstyle-plugin.version}
					</version>
					<dependencies>
						<dependency>
							<groupId>
	
com.fujitsu.fs.apt.maven.configs
							</groupId>
							<artifactId>
	
maven-apt-coding-style-config
							</artifactId>
							<version>
	
${apt.configs-coding-style.version}
							</version>
						</dependency>
					</dependencies>
					<configuration>
						<configLocation>
	
maven/maven-checkstyle-rules.xml
						</configLocation>
						<excludeDirs>
	
<excludeDir>${basedir}/target/clover/src</excludeDir>
						</excludeDirs>
					</configuration>
				</plugin>

				<plugin>
	
<groupId>com.fujitsu.fs.apt.maven.plugins</groupId>
	
<artifactId>maven-apt-pmd-plugin</artifactId>
	
<version>${apt.maven-apt-pmd-plugin.version}</version>
					<dependencies>
						<dependency>
							<groupId>
	
com.fujitsu.fs.apt.maven.configs
							</groupId>
							<artifactId>
	
maven-apt-coding-style-config
							</artifactId>
							<version>
	
${apt.configs-coding-style.version}
							</version>
						</dependency>
					</dependencies>
					<configuration>
	
<failurePriority>1</failurePriority>
						<rulesets>
	
<ruleset>pmd/normal-pmd-rules.xml</ruleset>
						</rulesets>
						<excludeDirs>
	
<excludeDir>${basedir}/target/clover/src</excludeDir>
						</excludeDirs>
					</configuration>
				</plugin>

				<plugin>
	
<groupId>org.apache.maven.plugins</groupId>
	
<artifactId>maven-eclipse-plugin</artifactId>
	
<version>${apt.maven-eclipse-plugin.version}</version>
					<configuration>
	
<projectNameTemplate>[artifactId]-[version]</projectNameTemplate>
	
<wtpmanifest>true</wtpmanifest>
	
<wtpapplicationxml>true</wtpapplicationxml>
	
<wtpversion>2.0</wtpversion>
					
<manifest>${project.build.directory}/generated-resources/eclipse/META-IN
F/MANIFEST.MF</manifest>
					</configuration>
				</plugin>			
				
			</plugins>

		</pluginManagement>



		<!--
============================================================= -->
		<!-- Site (aka bug workaround) profile -->
		<!--
============================================================= -->

		<profile>

			<!-- this profile should only be activated
during site generation,
				it adds some plugins to the build phase
that really shouldnt be
necessary but
				are required due to bugs in Maven -->

			<id>site</id>

			<activation>
				<property>
					<name>site</name>
					<value>true</value>
				</property>
			</activation>

			<build>
				<pluginManagement />

				<plugins>

					<!-- These shouldnt have to be
here at all, theyre only here to work
around a
						a bug in maven (two
really). firstly report plugins cant have
<dependencies>
						set in the <reporting>
section and second, reporting plugins wont
pickup 
						any configuration data
from the pluginManagement section. However 
						a plugin is only ever
initialised once in Maven (based upon it's
'identity') 
						and if a report pluing
is put in into the main build lifecycle it gets
properly 
						initialised, including
with dependencies however it wont do anything
as part 
						of the normal build, yet
will run properly as part of 'site' -->

					<plugin>
	
<groupId>com.fujitsu.fs.apt.maven.plugins</groupId>
	
<artifactId>maven-apt-pmd-plugin</artifactId>
						<executions>
							<execution>
	
<id>data-aggregation</id>
	
<phase>pre-site</phase>
								<goals>
	
<goal>aggregate</goal>
								</goals>
							</execution>
						</executions>
					</plugin>


					<plugin>
	
<groupId>org.apache.maven.plugins</groupId>
	
<artifactId>maven-clover-plugin</artifactId>
						<executions>
							<execution>
	
<id>data-aggregation</id>
	
<phase>pre-site</phase>
								<goals>
	
<goal>aggregate</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<plugin>
	
<groupId>com.fujitsu.fs.apt.maven.plugins</groupId>
	
<artifactId>maven-apt-checkstyle-plugin</artifactId>
						<executions>
							<execution>
	
<id>data-aggregation</id>
	
<phase>pre-site</phase>
								<goals>
	
<goal>aggregate</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

				</plugins>
			</build>
		</profile>




Brian E Fox wrote:
> 
> Are you sure this works? I am 99% sure I tried this recently and had
no
> luck.
> 
> -----Original Message-----
> From: jallen [mailto:john_h_allen@hotmail.com] 
> Sent: Saturday, January 05, 2008 11:41 AM
> To: users@maven.apache.org
> Subject: Re: buildManagement for reports
> 
> 
> Due to the way plugins are instantiated you can achieve what you wish
> doing
> the following:
> 
> Define the configurations of your reporting plugins via the standard
> <pluginsManagement> section of your parent POM (optional).
> 
> Then bind the reporting plugins to the build lifecycle of the children
> (i.e.
> in <build><plugins>). They will not run as they do not have a default
> phase,
> being designed to be run by site only. However Maven will instantiate
> them
> and will use the parent <pluginManagement> configs while doing so.
When
> site
> is run Maven will re-use the already instantiated reporting plugins. 
> 
> To control when this build binding should be applied you can either
put
> the
> plugins in a profile (and thus they only get defined in the parent) or
> bind
> them to pre-site, that way they'll only get instantiated when being
used
> in
> site generation.
> 
> John
> 
> 
> dennisl-2 wrote:
>> 
>> simon wrote:
>>> Hi,
>>> 
>>> I would like to define some report configuration in a parent pom, so
>>> that they apply to child modules. In particular, the
maven-pmd-plugin
>>> needs some config common to all the submodules. 
>>> 
>>> But I do not want those reports to actually *run* for the parent; it
>>> makes no sense to have a pmd report in the parent site's reports
>>> section, as the parent project has no code.
>>> 
>>> For a build plugin, this kind of configuration be done in the
>>> pluginManagement section. But configuring a report plugin in
>>> pluginManagement does not appear to affect reports, and there is no
>>> reportManagement section.
>>> 
>>> So what is the equivalent for report plugins?
>> 
>> Unfortunately there is no equivalent. But there is an issue for it if
>> you want to vote:
>> 
>> http://jira.codehaus.org/browse/MNG-1931
>> 
>>> Is it something to do with the reportSets section? I have read the
> maven
>>> docs on that several times and just don't understand what this is
> meant
>>> to do..
>> 
>> reportSets are used by plugins that output multiple reports. An
> example
>> of this is maven-changelog-plugin:
>> 
>>
>
http://maven.apache.org/plugins/maven-changelog-plugin/examples/selectin
> g-reports.html
>> 
>>> 
>>> Thanks,
>>> 
>>> Simon
>>> 
>>> 
>>>
---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>> 
>>> 
>> 
>> 
>> -- 
>> Dennis Lundberg
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
>> 
> 
> -- 
> View this message in context:
>
http://www.nabble.com/buildManagement-for-reports-tp14625165s177p1463551
> 6.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
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context:
http://www.nabble.com/buildManagement-for-reports-tp14625165s177p1464841
2.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


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


RE: buildManagement for reports

Posted by jallen <jo...@hotmail.com>.
Hi Brian,

Yes it works as it's the only way we can get plugin dependencies passed to
the reporting plugins, (see MNG-1948). Here's the profile we use, it started
off life doing nothing bar binding the plugins to the build but since then
we have added our own custom aggregation functionality and so they now run
goals.

The thing you want to make sure happens is that you see the plugins being
configured before the site phase of the build, then you should know that
they've been initialised as normal build plugins and should be available
when reporting comes to use them. 

Well that's how understand it :) This all started off life in 2.0.1 days,
core may have moved on such that simply binding them and not running any
mojos may no longer work ...

Hope it helps.

		<!-- ============================================================= -->
		<!-- Default settings for plugins used in profiles or run from -->
		<!-- the command line -->
		<!-- ============================================================= -->

		<pluginManagement>

			<plugins>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<configuration>
						<source>1.5</source>
						<target>1.5</target>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clover-plugin</artifactId>
					<version>
						${apt.maven-clover-plugin.version}
					</version>
					<dependencies>
						<dependency>
							<groupId>
								com.fujitsu.fs.apt.maven.configs
							</groupId>
							<artifactId>maven-apt-clover-config</artifactId>
							<version>
								${apt.configs-clover.version}
							</version>
						</dependency>
					</dependencies>
					<configuration>
						<flushPolicy>threaded</flushPolicy>
						<jdk>1.5</jdk>
						<flushInterval>100</flushInterval>
						<targetPercentage>0%</targetPercentage>
						<licenseLocation>
							clover-fujitsu.license
						</licenseLocation>
					</configuration>
				</plugin>

				<plugin>
					<groupId>com.fujitsu.fs.apt.maven.plugins</groupId>
					<artifactId>maven-apt-checkstyle-plugin</artifactId>
					<version>
						${apt.maven-apt-checkstyle-plugin.version}
					</version>
					<dependencies>
						<dependency>
							<groupId>
								com.fujitsu.fs.apt.maven.configs
							</groupId>
							<artifactId>
								maven-apt-coding-style-config
							</artifactId>
							<version>
								${apt.configs-coding-style.version}
							</version>
						</dependency>
					</dependencies>
					<configuration>
						<configLocation>
							maven/maven-checkstyle-rules.xml
						</configLocation>
						<excludeDirs>
							<excludeDir>${basedir}/target/clover/src</excludeDir>
						</excludeDirs>
					</configuration>
				</plugin>

				<plugin>
					<groupId>com.fujitsu.fs.apt.maven.plugins</groupId>
					<artifactId>maven-apt-pmd-plugin</artifactId>
					<version>${apt.maven-apt-pmd-plugin.version}</version>
					<dependencies>
						<dependency>
							<groupId>
								com.fujitsu.fs.apt.maven.configs
							</groupId>
							<artifactId>
								maven-apt-coding-style-config
							</artifactId>
							<version>
								${apt.configs-coding-style.version}
							</version>
						</dependency>
					</dependencies>
					<configuration>
						<failurePriority>1</failurePriority>
						<rulesets>
							<ruleset>pmd/normal-pmd-rules.xml</ruleset>
						</rulesets>
						<excludeDirs>
							<excludeDir>${basedir}/target/clover/src</excludeDir>
						</excludeDirs>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-eclipse-plugin</artifactId>
					<version>${apt.maven-eclipse-plugin.version}</version>
					<configuration>
						<projectNameTemplate>[artifactId]-[version]</projectNameTemplate>
						<wtpmanifest>true</wtpmanifest>
						<wtpapplicationxml>true</wtpapplicationxml>
						<wtpversion>2.0</wtpversion>
					
<manifest>${project.build.directory}/generated-resources/eclipse/META-INF/MANIFEST.MF</manifest>
					</configuration>
				</plugin>			
				
			</plugins>

		</pluginManagement>



		<!-- ============================================================= -->
		<!-- Site (aka bug workaround) profile -->
		<!-- ============================================================= -->

		<profile>

			<!-- this profile should only be activated during site generation,
				it adds some plugins to the build phase that really shouldnt be
necessary but
				are required due to bugs in Maven -->

			<id>site</id>

			<activation>
				<property>
					<name>site</name>
					<value>true</value>
				</property>
			</activation>

			<build>
				<pluginManagement />

				<plugins>

					<!-- These shouldnt have to be here at all, theyre only here to work
around a
						a bug in maven (two really). firstly report plugins cant have
<dependencies>
						set in the <reporting> section and second, reporting plugins wont
pickup 
						any configuration data from the pluginManagement section. However 
						a plugin is only ever initialised once in Maven (based upon it's
'identity') 
						and if a report pluing is put in into the main build lifecycle it gets
properly 
						initialised, including with dependencies however it wont do anything
as part 
						of the normal build, yet will run properly as part of 'site' -->

					<plugin>
						<groupId>com.fujitsu.fs.apt.maven.plugins</groupId>
						<artifactId>maven-apt-pmd-plugin</artifactId>
						<executions>
							<execution>
								<id>data-aggregation</id>
								<phase>pre-site</phase>
								<goals>
									<goal>aggregate</goal>
								</goals>
							</execution>
						</executions>
					</plugin>					

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-clover-plugin</artifactId>
						<executions>
							<execution>
								<id>data-aggregation</id>
								<phase>pre-site</phase>
								<goals>
									<goal>aggregate</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>com.fujitsu.fs.apt.maven.plugins</groupId>
						<artifactId>maven-apt-checkstyle-plugin</artifactId>
						<executions>
							<execution>
								<id>data-aggregation</id>
								<phase>pre-site</phase>
								<goals>
									<goal>aggregate</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

				</plugins>
			</build>
		</profile>




Brian E Fox wrote:
> 
> Are you sure this works? I am 99% sure I tried this recently and had no
> luck.
> 
> -----Original Message-----
> From: jallen [mailto:john_h_allen@hotmail.com] 
> Sent: Saturday, January 05, 2008 11:41 AM
> To: users@maven.apache.org
> Subject: Re: buildManagement for reports
> 
> 
> Due to the way plugins are instantiated you can achieve what you wish
> doing
> the following:
> 
> Define the configurations of your reporting plugins via the standard
> <pluginsManagement> section of your parent POM (optional).
> 
> Then bind the reporting plugins to the build lifecycle of the children
> (i.e.
> in <build><plugins>). They will not run as they do not have a default
> phase,
> being designed to be run by site only. However Maven will instantiate
> them
> and will use the parent <pluginManagement> configs while doing so. When
> site
> is run Maven will re-use the already instantiated reporting plugins. 
> 
> To control when this build binding should be applied you can either put
> the
> plugins in a profile (and thus they only get defined in the parent) or
> bind
> them to pre-site, that way they'll only get instantiated when being used
> in
> site generation.
> 
> John
> 
> 
> dennisl-2 wrote:
>> 
>> simon wrote:
>>> Hi,
>>> 
>>> I would like to define some report configuration in a parent pom, so
>>> that they apply to child modules. In particular, the maven-pmd-plugin
>>> needs some config common to all the submodules. 
>>> 
>>> But I do not want those reports to actually *run* for the parent; it
>>> makes no sense to have a pmd report in the parent site's reports
>>> section, as the parent project has no code.
>>> 
>>> For a build plugin, this kind of configuration be done in the
>>> pluginManagement section. But configuring a report plugin in
>>> pluginManagement does not appear to affect reports, and there is no
>>> reportManagement section.
>>> 
>>> So what is the equivalent for report plugins?
>> 
>> Unfortunately there is no equivalent. But there is an issue for it if
>> you want to vote:
>> 
>> http://jira.codehaus.org/browse/MNG-1931
>> 
>>> Is it something to do with the reportSets section? I have read the
> maven
>>> docs on that several times and just don't understand what this is
> meant
>>> to do..
>> 
>> reportSets are used by plugins that output multiple reports. An
> example
>> of this is maven-changelog-plugin:
>> 
>>
> http://maven.apache.org/plugins/maven-changelog-plugin/examples/selectin
> g-reports.html
>> 
>>> 
>>> Thanks,
>>> 
>>> Simon
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>> 
>>> 
>> 
>> 
>> -- 
>> Dennis Lundberg
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/buildManagement-for-reports-tp14625165s177p1463551
> 6.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
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/buildManagement-for-reports-tp14625165s177p14648412.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


RE: buildManagement for reports

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Are you sure this works? I am 99% sure I tried this recently and had no
luck.

-----Original Message-----
From: jallen [mailto:john_h_allen@hotmail.com] 
Sent: Saturday, January 05, 2008 11:41 AM
To: users@maven.apache.org
Subject: Re: buildManagement for reports


Due to the way plugins are instantiated you can achieve what you wish
doing
the following:

Define the configurations of your reporting plugins via the standard
<pluginsManagement> section of your parent POM (optional).

Then bind the reporting plugins to the build lifecycle of the children
(i.e.
in <build><plugins>). They will not run as they do not have a default
phase,
being designed to be run by site only. However Maven will instantiate
them
and will use the parent <pluginManagement> configs while doing so. When
site
is run Maven will re-use the already instantiated reporting plugins. 

To control when this build binding should be applied you can either put
the
plugins in a profile (and thus they only get defined in the parent) or
bind
them to pre-site, that way they'll only get instantiated when being used
in
site generation.

John


dennisl-2 wrote:
> 
> simon wrote:
>> Hi,
>> 
>> I would like to define some report configuration in a parent pom, so
>> that they apply to child modules. In particular, the maven-pmd-plugin
>> needs some config common to all the submodules. 
>> 
>> But I do not want those reports to actually *run* for the parent; it
>> makes no sense to have a pmd report in the parent site's reports
>> section, as the parent project has no code.
>> 
>> For a build plugin, this kind of configuration be done in the
>> pluginManagement section. But configuring a report plugin in
>> pluginManagement does not appear to affect reports, and there is no
>> reportManagement section.
>> 
>> So what is the equivalent for report plugins?
> 
> Unfortunately there is no equivalent. But there is an issue for it if
> you want to vote:
> 
> http://jira.codehaus.org/browse/MNG-1931
> 
>> Is it something to do with the reportSets section? I have read the
maven
>> docs on that several times and just don't understand what this is
meant
>> to do..
> 
> reportSets are used by plugins that output multiple reports. An
example
> of this is maven-changelog-plugin:
> 
>
http://maven.apache.org/plugins/maven-changelog-plugin/examples/selectin
g-reports.html
> 
>> 
>> Thanks,
>> 
>> Simon
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
> 
> 
> -- 
> Dennis Lundberg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context:
http://www.nabble.com/buildManagement-for-reports-tp14625165s177p1463551
6.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


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


Re: buildManagement for reports

Posted by jallen <jo...@hotmail.com>.
Due to the way plugins are instantiated you can achieve what you wish doing
the following:

Define the configurations of your reporting plugins via the standard
<pluginsManagement> section of your parent POM (optional).

Then bind the reporting plugins to the build lifecycle of the children (i.e.
in <build><plugins>). They will not run as they do not have a default phase,
being designed to be run by site only. However Maven will instantiate them
and will use the parent <pluginManagement> configs while doing so. When site
is run Maven will re-use the already instantiated reporting plugins. 

To control when this build binding should be applied you can either put the
plugins in a profile (and thus they only get defined in the parent) or bind
them to pre-site, that way they'll only get instantiated when being used in
site generation.

John


dennisl-2 wrote:
> 
> simon wrote:
>> Hi,
>> 
>> I would like to define some report configuration in a parent pom, so
>> that they apply to child modules. In particular, the maven-pmd-plugin
>> needs some config common to all the submodules. 
>> 
>> But I do not want those reports to actually *run* for the parent; it
>> makes no sense to have a pmd report in the parent site's reports
>> section, as the parent project has no code.
>> 
>> For a build plugin, this kind of configuration be done in the
>> pluginManagement section. But configuring a report plugin in
>> pluginManagement does not appear to affect reports, and there is no
>> reportManagement section.
>> 
>> So what is the equivalent for report plugins?
> 
> Unfortunately there is no equivalent. But there is an issue for it if
> you want to vote:
> 
> http://jira.codehaus.org/browse/MNG-1931
> 
>> Is it something to do with the reportSets section? I have read the maven
>> docs on that several times and just don't understand what this is meant
>> to do..
> 
> reportSets are used by plugins that output multiple reports. An example
> of this is maven-changelog-plugin:
> 
> http://maven.apache.org/plugins/maven-changelog-plugin/examples/selecting-reports.html
> 
>> 
>> Thanks,
>> 
>> Simon
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
> 
> 
> -- 
> Dennis Lundberg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/buildManagement-for-reports-tp14625165s177p14635516.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


Re: buildManagement for reports

Posted by Dennis Lundberg <de...@apache.org>.
simon wrote:
> Hi,
> 
> I would like to define some report configuration in a parent pom, so
> that they apply to child modules. In particular, the maven-pmd-plugin
> needs some config common to all the submodules. 
> 
> But I do not want those reports to actually *run* for the parent; it
> makes no sense to have a pmd report in the parent site's reports
> section, as the parent project has no code.
> 
> For a build plugin, this kind of configuration be done in the
> pluginManagement section. But configuring a report plugin in
> pluginManagement does not appear to affect reports, and there is no
> reportManagement section.
> 
> So what is the equivalent for report plugins?

Unfortunately there is no equivalent. But there is an issue for it if
you want to vote:

http://jira.codehaus.org/browse/MNG-1931

> Is it something to do with the reportSets section? I have read the maven
> docs on that several times and just don't understand what this is meant
> to do..

reportSets are used by plugins that output multiple reports. An example
of this is maven-changelog-plugin:

http://maven.apache.org/plugins/maven-changelog-plugin/examples/selecting-reports.html

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


-- 
Dennis Lundberg

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