Maven Doxia

Update Doxia Decoration model to actually work in reactor build.

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.0-alpha-9
  • Component/s: Decoration Model
  • Labels:
    None
  • Number of attachments :
    6

Description

This is a major patch to the decoration model to bring some sanity in the link resolution when it is used under the reactor build. It generates breadcrumbs and item links correctly in all scenarios that I have tested (the current HEAD code does not) and passes all the unit tests that are already there.

  1. doxia-decoration.patch
    07/Jan/07 7:17 AM
    29 kB
    Henning Schmiedehausen
  2. doxia-decoration.patch
    07/Jan/07 7:15 AM
    16 kB
    Henning Schmiedehausen
  3. doxia-decoration-3.patch
    27/Jan/07 12:12 PM
    31 kB
    Henning Schmiedehausen
  4. doxia-decoration-4.patch
    07/Apr/07 3:42 PM
    51 kB
    Henning Schmiedehausen
  5. doxia-decoration-5.patch
    08/Apr/07 6:39 AM
    51 kB
    Henning Schmiedehausen
  6. org.apache.maven.doxia.site.decoration.inheritance.DecorationModelInheritenceAssemblerTest.txt
    27/Jan/07 8:05 AM
    26 kB
    Vincent Siveton

Activity

Hide
Henning Schmiedehausen added a comment -

That patch is better. Also contains the new classes.

Show
Henning Schmiedehausen added a comment - That patch is better. Also contains the new classes.
Hide
Vincent Siveton added a comment -

I tried your latest patch and actual tests failed. Could you provide us test cases or review these? Tx.
Another way, as you know, we change license headers.

Show
Vincent Siveton added a comment - I tried your latest patch and actual tests failed. Could you provide us test cases or review these? Tx. Another way, as you know, we change license headers.
Hide
Vincent Siveton added a comment -

I forgot to say that I tried with maven 2.0.4 and 2.0.5

Show
Vincent Siveton added a comment - I forgot to say that I tried with maven 2.0.4 and 2.0.5
Hide
Henning Schmiedehausen added a comment -

Yep, same here. Maven 2.0.4 and 2.0.5-SNAPSHOT (do we have a release yet?).

Which platform did you use? I ran my tests on Linux, I don't have a built HEAD on Windows and the process of getting the jumble of maven, plexus, doxia and everything else to get built took my fastest machines two hours. I don't want to think how long my old windows notebook would take for this...

If you are on Windows, I will try to run the tests for you this weekend.

Can you attach the failed test report? That would help me tremendously.

Show
Henning Schmiedehausen added a comment - Yep, same here. Maven 2.0.4 and 2.0.5-SNAPSHOT (do we have a release yet?). Which platform did you use? I ran my tests on Linux, I don't have a built HEAD on Windows and the process of getting the jumble of maven, plexus, doxia and everything else to get built took my fastest machines two hours. I don't want to think how long my old windows notebook would take for this... If you are on Windows, I will try to run the tests for you this weekend. Can you attach the failed test report? That would help me tremendously.
Hide
Vincent Siveton added a comment -

Here is the surefire report.
I am on windows with 2.0.4 and 2.0.6-snapshot (trunk)
I tried with your latest patch:
http://jira.codehaus.org/secure/attachment/25052/doxia-decoration.patch

HTH

Show
Vincent Siveton added a comment - Here is the surefire report. I am on windows with 2.0.4 and 2.0.6-snapshot (trunk) I tried with your latest patch: http://jira.codehaus.org/secure/attachment/25052/doxia-decoration.patch HTH
Hide
Henning Schmiedehausen added a comment -

Hm, that is a forward-slash / backward-slash issue. Will look into that.

Show
Henning Schmiedehausen added a comment - Hm, that is a forward-slash / backward-slash issue. Will look into that.
Hide
Henning Schmiedehausen added a comment -

This version of the path passes all tests for me on Linux and Windows.

Show
Henning Schmiedehausen added a comment - This version of the path passes all tests for me on Linux and Windows.
Hide
Vincent Siveton added a comment -

I got a NPE in a multi project case without any documentation.

java.lang.NullPointerException
        at java.io.File.<init>(File.java:194)
        at org.apache.maven.doxia.site.decoration.inheritance.PathUtils.getRelativeFilePath(PathUtils.java:130)
        at org.apache.maven.doxia.site.decoration.inheritance.PathUtils.getRelativePath(PathUtils.java:103)
        at org.apache.maven.doxia.site.decoration.inheritance.PathUtils.convertPath(PathUtils.java:40)
        at org.apache.maven.doxia.site.decoration.inheritance.DefaultDecorationModelInheritanceAssembler.convertPath(DefaultDecorationModelInheritanceAssembler.java:338)
        at org.apache.maven.doxia.site.decoration.inheritance.DefaultDecorationModelInheritanceAssembler.resolveBannerPaths(DefaultDecorationModelInheritanceAssembler.java:150)
        at org.apache.maven.doxia.site.decoration.inheritance.DefaultDecorationModelInheritanceAssembler.resolvePaths(DefaultDecorationModelInheritanceAssembler.java:97)
        at org.apache.maven.plugins.site.AbstractSiteRenderingMojo.getDecorationModel(AbstractSiteRenderingMojo.java:555)
...
Show
Vincent Siveton added a comment - I got a NPE in a multi project case without any documentation.
java.lang.NullPointerException
        at java.io.File.<init>(File.java:194)
        at org.apache.maven.doxia.site.decoration.inheritance.PathUtils.getRelativeFilePath(PathUtils.java:130)
        at org.apache.maven.doxia.site.decoration.inheritance.PathUtils.getRelativePath(PathUtils.java:103)
        at org.apache.maven.doxia.site.decoration.inheritance.PathUtils.convertPath(PathUtils.java:40)
        at org.apache.maven.doxia.site.decoration.inheritance.DefaultDecorationModelInheritanceAssembler.convertPath(DefaultDecorationModelInheritanceAssembler.java:338)
        at org.apache.maven.doxia.site.decoration.inheritance.DefaultDecorationModelInheritanceAssembler.resolveBannerPaths(DefaultDecorationModelInheritanceAssembler.java:150)
        at org.apache.maven.doxia.site.decoration.inheritance.DefaultDecorationModelInheritanceAssembler.resolvePaths(DefaultDecorationModelInheritanceAssembler.java:97)
        at org.apache.maven.plugins.site.AbstractSiteRenderingMojo.getDecorationModel(AbstractSiteRenderingMojo.java:555)
...
Hide
Jason van Zyl added a comment -

Unschedule until the patch works without error, I tried it too and it breaks.

Show
Jason van Zyl added a comment - Unschedule until the patch works without error, I tried it too and it breaks.
Hide
Henning Schmiedehausen added a comment -

Ok, you got me confused. This is only possible when a PathDescriptor contains null for both the PathUrl and the relativePath. Which can only happen when the PathDescriptor has been constructed using a 'null' path. And the only place where this is possible is in PathUtils line 47 and there is an explicit null test in front of it.

Can you give some pointers on what project exactly you tried to build the sites for? Or is that some non-public site?

If possible, could you put a breakpoint at PathUtils::getRelativePath(String, String) and tell me what exactly goes in there. I'd guess that oldPath is null.

I'll add another patch shortly which has another minor fix and I will add some explicit testing on that. Also some unit tests.

Show
Henning Schmiedehausen added a comment - Ok, you got me confused. This is only possible when a PathDescriptor contains null for both the PathUrl and the relativePath. Which can only happen when the PathDescriptor has been constructed using a 'null' path. And the only place where this is possible is in PathUtils line 47 and there is an explicit null test in front of it. Can you give some pointers on what project exactly you tried to build the sites for? Or is that some non-public site? If possible, could you put a breakpoint at PathUtils::getRelativePath(String, String) and tell me what exactly goes in there. I'd guess that oldPath is null. I'll add another patch shortly which has another minor fix and I will add some explicit testing on that. Also some unit tests.
Hide
Henning Schmiedehausen added a comment -

Updated version for the doxia decoration patch. This should now avoid all possible NPE problems even with complex builds. Also adds some unit tests for the code.

Show
Henning Schmiedehausen added a comment - Updated version for the doxia decoration patch. This should now avoid all possible NPE problems even with complex builds. Also adds some unit tests for the code.
Hide
Henning Schmiedehausen added a comment -

This patch also adds a number of unit tests. Unfortunately as I can not modify the issue, I can not change the "contains unit tests" field.

Show
Henning Schmiedehausen added a comment - This patch also adds a number of unit tests. Unfortunately as I can not modify the issue, I can not change the "contains unit tests" field.
Hide
Henning Schmiedehausen added a comment -

the unit tests in the last patch actually depended on the existence of a "/tmp/foo" directory (they might report a trailing slash). This is an updated version where the unit tests pass in all cases. Still need to test on Windows, though.

Show
Henning Schmiedehausen added a comment - the unit tests in the last patch actually depended on the existence of a "/tmp/foo" directory (they might report a trailing slash). This is an updated version where the unit tests pass in all cases. Still need to test on Windows, though.
Hide
Jason van Zyl added a comment -

Tests now pass and seem fine.

Show
Jason van Zyl added a comment - Tests now pass and seem fine.
Hide
Jason van Zyl added a comment -

Patch applied.

Show
Jason van Zyl added a comment - Patch applied.

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: