[ 
http://jira.codehaus.org/browse/MSITE-307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=165560#action_165560
 ] 

Hamid Ben Malek commented on MSITE-307:
---------------------------------------

There are many problems with the site plugin: 
1) The first issue is that it tries to build the whole project again (and even 
many times because some reports need to do the buid again). This is a very bad 
thing. Even if you run mvn package first, and then run the site generation, the 
build process repeats all over again which takes long time for big and complex 
projects consisting of multi-modules. This needs to be fixed: if the project is 
already built, none of the reports and site plugin should attempt to build 
again.

2) The second issue is that the sites generated in the sub-modules are not 
copied to the top level (the parent site). The consequence of this is that when 
you click on a sub-module link on the left navigation of the parent site, you 
get an empty page (does not take you to the site of the sub-module). And this 
happens whether you have run mvn site or mvn site:stage or mvn site:deploy (the 
various sites of the sub-modules are never aggregated together with the top 
level site to form a complete one site). This needs to be fixed. I blieve the 
the designers of this plugin thought that the sub-modules projects may not be 
on the same server as the parent project and therefore it would not make sense 
to copy the sites of the submodules to the parent, but this is a very lame 
execuse. It is very inappropriate for a developer to manually copy the sites of 
the submodules to the top level before distributing the final whole and 
complete site.

> Site generation broken with multi-module property inheritence
> -------------------------------------------------------------
>
>                 Key: MSITE-307
>                 URL: http://jira.codehaus.org/browse/MSITE-307
>             Project: Maven 2.x Site Plugin
>          Issue Type: Bug
>          Components: inheritance
>    Affects Versions: 2.0-beta-6
>         Environment: Ubuntu 7.10, Maven 2.0.8
>            Reporter: Eric Ryan
>         Attachments: module_project.zip, mvn_output.txt
>
>
> 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 used by the child poms to resolve the 
> parent pom (they are used in the <parent> tags).  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 
> recieve a sucessful 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 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.
> From my discussion with others on the Maven mailing list, it seems as though 
> some other users are experiencing this same issue with site property 
> inheritence.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to