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

mithrandir edited comment on MSITE-307 at 6/13/08 2:48 AM:
---------------------------------------------------------------

I've reviewed our solution using the actual SNAPSHOT of the site plugin.
Indeed, the build is successfull. But there is still a problem.

I attached the output of Maven which was produced while running the site phase 
in the sample project which was attached to this issue earlier.

First I recognized that if running site on the cleaned project (and not 
installed in my local repository!) the build fails as Maven tries to get the 
module artifacts from the local repository instead of using the project files 
themselves. You can verify that in the attached output log in lines 1 to 84.
Is this the desired behavior? All other phases don't try to use the local 
repository for the modules and use the project files themselves...

The second and more important thing I discovered is that the resolution of 
properties still doesn't work properly.
If you have a look at lines 406 to 419 of the attached output file you see that 
the site plugin again tries to download a wrong version of the parent pom and 
site.xml while processing the first module (i.e. 
"module-app-${xx_test_module-app_version}"). So it seems that the property 
itself is used instead of the value that it represents when processing the 
modules. I believe that it doesn't happen again for the other two modules as 
the wrong parent then already exists in the local repository. You can verify 
this by running the site phase in the project an then have a look into your 
local repository. There you will find a version folder 
"${xx_test_module-app_version}" in the artifact folder "module-app".

The fact that it doesn't end up in a build error makes it even worse as it 
leaves the impression that everything worked correctly which is not the case.

      was (Author: mithrandir):
    I've reviewed our solution using the actual SNAPSHOT of the site plugin.
Indeed, the build is successfull. But there is still a problem.

I attached the output of Maven which was produced while running the site phase 
in the sample project which is attached to this issue.

First I recognized that if running site on the cleaned project (and not 
installed in my local repository!) the build fails as Maven tries to get the 
module artifacts from the local repository instead of using the project files 
themselves. You can verify that in the attached output log in lines 1 to 84.
Is this the desired behavior? All other phases don't try to use the local 
repository for the modules and use the project files themselves...

The second and more important thing I discovered is that the resolution of 
properties still doesn't work properly.
If you have a look at lines 406 to 419 you see that the site plugin again tries 
to download a wrong version of the parent pom and site.xml while processing the 
first module (i.e. "module-app-${xx_test_module-app_version}"). So it seems 
that the property itself is used instead of the value that it represents when 
processing the modules. I believe that it doesn't happen again for the other 
two modules as the wrong parent then already exists in the local repository. 
You can verify this by running the site phase in the project an then have a 
look into your local repository. There you will find a version folder 
"${xx_test_module-app_version}" in the artifact folder "module-app".

The fact that it doesn't end up in a build error makes it even worse as it 
leaves the impression that everything worked correctly which it didn't.
  
> 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