You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Graham Leggett <mi...@sharp.fm> on 2013/01/14 17:32:37 UTC

Site plugin to document properties in the pom?

Hi all,

I am looking for a plugin that will take the properties defined in the POM, and include these properties in the generated site.

Does such a plugin exist?

The problem I am trying to solve is that I have properties defined in a parent POM, and would like to expose these properties in documentation without manually copying the properties into a wiki or have some other manual process.

Regards,
Graham
--


Re: Site plugin to document properties in the pom?

Posted by Hervé BOUTEMY <he...@free.fr>.
I wrote some documentation about properties available during Velocity 
processing in Doxia [1]
project (type MavenProject) should be available, which has getProperties() 
method: this should be what you are looking for

this documentation can probably be enhanced: any feedback appreciated

Regards,

Hervé


[1] http://maven.apache.org/doxia/doxia-sitetools/doxia-site-renderer/

Le mardi 15 janvier 2013 15:45:18 Mark H. Wood a écrit :
> On Mon, Jan 14, 2013 at 10:26:56PM +0200, Graham Leggett wrote:
> > On 14 Jan 2013, at 10:02 PM, Mirko Friedenhagen <mf...@gmail.com> 
wrote:
> > > I once was successful with referencing injected properties in velocity
> > > by using the get method. Maybe something like:
> > > ${project.properties.get("tomcat.port.http.confluence43.live")}
> > > will work?
> > 
> > Alas, no.
> > 
> > The idea is that the properties in the pom and the properties published to
> > the site are always in sync, even after the current crop of architects
> > have moved on from the project. If you have to add a property in two
> > steps, there is no way the project will stay in sync.
> Yeah, he's asking for a way to get the site plugin to ask the POM for
> a list of all defined properties, whatever they may be today, so that
> the plugin can enumerate them (with their values I suppose) in its
> report *without knowing their names in advance*.
> 
> The value of project.properties seems to be a java.util.Properties, so
> there may be some way to get at its propertyNames() method, or the
> keys() keySet() etc. methods it inherits from Hashtable, but you will
> probably have to write your own report plugin to make use of any of
> them.
> 
> org.codehaus.mojo:properties-maven-plugin seems to know how to
> enumerate properties, but it doesn't do reporting.  It could perhaps
> be studied as a model.

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


Re: Site plugin to document properties in the pom?

Posted by "Mark H. Wood" <mw...@IUPUI.Edu>.
On Mon, Jan 14, 2013 at 10:26:56PM +0200, Graham Leggett wrote:
> On 14 Jan 2013, at 10:02 PM, Mirko Friedenhagen <mf...@gmail.com> wrote:
> 
> > I once was successful with referencing injected properties in velocity
> > by using the get method. Maybe something like:
> > ${project.properties.get("tomcat.port.http.confluence43.live")}
> > will work?
> 
> Alas, no.
> 
> The idea is that the properties in the pom and the properties published to the site are always in sync, even after the current crop of architects have moved on from the project. If you have to add a property in two steps, there is no way the project will stay in sync.

Yeah, he's asking for a way to get the site plugin to ask the POM for
a list of all defined properties, whatever they may be today, so that
the plugin can enumerate them (with their values I suppose) in its
report *without knowing their names in advance*.

The value of project.properties seems to be a java.util.Properties, so
there may be some way to get at its propertyNames() method, or the
keys() keySet() etc. methods it inherits from Hashtable, but you will
probably have to write your own report plugin to make use of any of
them.

org.codehaus.mojo:properties-maven-plugin seems to know how to
enumerate properties, but it doesn't do reporting.  It could perhaps
be studied as a model.

-- 
Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
There's an app for that:  your browser

Re: Site plugin to document properties in the pom?

Posted by Graham Leggett <mi...@sharp.fm>.
On 14 Jan 2013, at 10:02 PM, Mirko Friedenhagen <mf...@gmail.com> wrote:

> I once was successful with referencing injected properties in velocity
> by using the get method. Maybe something like:
> ${project.properties.get("tomcat.port.http.confluence43.live")}
> will work?

Alas, no.

The idea is that the properties in the pom and the properties published to the site are always in sync, even after the current crop of architects have moved on from the project. If you have to add a property in two steps, there is no way the project will stay in sync.

Regards,
Graham
--


Re: Site plugin to document properties in the pom?

Posted by Mirko Friedenhagen <mf...@gmail.com>.
Hello Graham,

I once was successful with referencing injected properties in velocity
by using the get method. Maybe something like:
${project.properties.get("tomcat.port.http.confluence43.live")}
will work?

Regards Mirko

On Mon, Jan 14, 2013 at 5:40 PM, Graham Leggett <mi...@sharp.fm> wrote:
> On 14 Jan 2013, at 6:36 PM, Olivier Lamy <ol...@apache.org> wrote:
>
>> maybe http://maven.apache.org/plugins/maven-site-plugin/examples/creating-content.html#Filtering
>
> Doesn't seem to fit, alas, as you have to come up with your own template and manually add the new properties to the template.
>
> In addition, my properties contain dots:
>
>   <properties>
>     <tomcat.port.http.confluence43.live>7999</tomcat.port.http.confluence43.live>
>     <tomcat.port.shutdown.confluence43.live>7998</tomcat.port.shutdown.confluence43.live>
>     <httpd.port.http.repo.core>7997</httpd.port.http.repo.core>
>     <httpd.address.http.repo.core>127.0.0.1</httpd.address.http.repo.core>
>   </properties>
>
> Regards,
> Graham
> --
>

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


Re: Site plugin to document properties in the pom?

Posted by Graham Leggett <mi...@sharp.fm>.
On 14 Jan 2013, at 6:36 PM, Olivier Lamy <ol...@apache.org> wrote:

> maybe http://maven.apache.org/plugins/maven-site-plugin/examples/creating-content.html#Filtering

Doesn't seem to fit, alas, as you have to come up with your own template and manually add the new properties to the template.

In addition, my properties contain dots:

  <properties>
    <tomcat.port.http.confluence43.live>7999</tomcat.port.http.confluence43.live>
    <tomcat.port.shutdown.confluence43.live>7998</tomcat.port.shutdown.confluence43.live>
    <httpd.port.http.repo.core>7997</httpd.port.http.repo.core>
    <httpd.address.http.repo.core>127.0.0.1</httpd.address.http.repo.core>
  </properties>

Regards,
Graham
--


Re: Site plugin to document properties in the pom?

Posted by Olivier Lamy <ol...@apache.org>.
maybe http://maven.apache.org/plugins/maven-site-plugin/examples/creating-content.html#Filtering


2013/1/14 Graham Leggett <mi...@sharp.fm>:
> Hi all,
>
> I am looking for a plugin that will take the properties defined in the POM, and include these properties in the generated site.
>
> Does such a plugin exist?
>
> The problem I am trying to solve is that I have properties defined in a parent POM, and would like to expose these properties in documentation without manually copying the properties into a wiki or have some other manual process.
>
> Regards,
> Graham
> --
>



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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