You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Prystash,John" <pr...@oclc.org> on 2008/03/03 15:17:48 UTC

RE: Maven2 site plugin inheritence

I've used this workaround to get help with this issue, at least for
site-deploy, in the parent POM:

  <url>file://${user.dir}/site</url>

All the links in the resulting site work.  This might not help with the
inheritance issue, but it might give you a place to start from.

-----Original Message-----
From: ewryan [mailto:ewryan@gmail.com] 
Sent: Thursday, February 28, 2008 1:53 PM
To: users@maven.apache.org
Subject: Maven2 site plugin inheritence


I have a multi-module project with the following directory structure:

my-app
|
|---my-client-ui
|   |
|   |---pom.xml
|
|---my-core
|   |
|   |---pom.xml
|
|---my-common
|   |
|   |---pom.xml
|
|---pom.xml


I define properties such as ${myVersion}, ${myArtifactId}, ${myGroupId}
in the parent pom.  These properties are inherited by the children (as
expected) when running goals such as clean, package, or install.    

I start to see problems when I try to use the site plugin.  I first run
the install goal to install my project's jars and poms into my local
repo(~/.m2/repository/).  I then verify that the jars and poms are in my
local repo.  When I try to run the site plugin it seems as though maven
is unable to interpret the properties defined in the parent pom.  I
receive the following output for each module:

[INFO]
------------------------------------------------------------------------
[INFO] Building my-client-ui
[INFO]    task-segment: [site]
[INFO]
------------------------------------------------------------------------
[INFO] [site:site]
Downloading:
http://repo1.maven.org/maven2/${myGroupId}/${myArtifactId}/${myVersion}/
${myArtifactId}-${myVersion}.pom
[WARNING] Unable to load parent project from repository: Failed to
validate POM for project ${myGroupId}:${myArtifactId} at Artifact
[${myGroupId}:${myArtifactId}:pom:${myVersion}]
[INFO] Generating "Continuous Integration" report.......


I've tried using site:deploy, site:run, and site:stage.  In all cases I
receive a successful build, but all sites generated contain broken
links.
(Note. parent pom's distributionManagement site
url=file:///home/eric/tmp) 

When using site:deploy, there are two issues with the site.  The first
is that none of the modules are listed for the project on the left hand
side of the screen.  The second is that when I go to the Dependence
Convergence section, the links to my project's modules are broken.  In
example, the link to my-client-ui incorrectly points to
http://www.mycompany.com/my-client-ui
when it is in fact located at file:///home/eric/tmp/my-client-ui  (Note.

http://www.mycompany.com is defined in the parent pom as the project's
url).  

site:run demonstrates the same problems as site:deploy. 

When using site:stage -DstagingDirectory=/home/eric/tmp, there are again
two issues w/ the site.  The first is the same, none of the modules are
listed on the left hand side of the screen.  The second is also the
same, except that the links in the Dependency Convergence section now
point to file:///home/eric/localhost/home/eric/tmp/my-client-ui.  This
is incorrect because the files are actually located at
file:///home/eric/tmp/localhost/home/eric/tmp/my-client-ui.  It is
missing the tmp directory in the url string.  

The only way I've been able to get the modules to be displayed on the
left hand side of the screen is using mvn -N site site:deploy.  In this
case, the links point to the "correct" place
(file:///home/eric/tmp/my-client-ui), but the submodule's sites are
never build because of the -N (non-recursive) flag.  Another thing to
note is that the Dependency Convergence section is totally missing from
this site.

The only way I've been able to build a site with links that resolve
properly is if I remove all instances of properties in all of my poms
and replace them with hard coded values.  In this case, the correct
links for the modules do appear on the left hand side of the screen.
The downfall to this approach is that the links in the Dependency
Convergence section now point to http://www.mycompany.com/my-client-ui.

My question is, is it possible for me to use the site plugin with
property inheritance?
--
View this message in context:
http://www.nabble.com/Maven2-site-plugin-inheritence-tp15743257s177p1574
3257.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