Issue Details (XML | Word | Printable)

Key: DOXIA-91
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jason van Zyl
Reporter: Henning Schmiedehausen
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Maven Doxia

Update Doxia Decoration model to actually work in reactor build.

Created: 07/Jan/07 07:15 AM   Updated: 11/Jul/07 09:12 AM   Resolved: 28/May/07 12:58 PM
Return to search
Component/s: Decoration Model
Affects Version/s: None
Fix Version/s: 1.0-alpha-9

Time Tracking:
Not Specified

File Attachments: 1. Text File doxia-decoration-3.patch (31 kB)
2. Text File doxia-decoration-4.patch (51 kB)
3. Text File doxia-decoration-5.patch (51 kB)
4. Text File doxia-decoration.patch (29 kB)
5. Text File doxia-decoration.patch (16 kB)
6. Text File org.apache.maven.doxia.site.decoration.inheritance.DecorationModelInheritenceAssemblerTest.txt (26 kB)



 Description  « Hide

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.



Henning Schmiedehausen added a comment - 07/Jan/07 07:17 AM

That patch is better. Also contains the new classes.


Vincent Siveton added a comment - 16/Jan/07 07:57 PM

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.


Vincent Siveton added a comment - 16/Jan/07 07:59 PM

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


Henning Schmiedehausen added a comment - 24/Jan/07 04:25 PM

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.


Vincent Siveton added a comment - 27/Jan/07 08:05 AM

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


Henning Schmiedehausen added a comment - 27/Jan/07 11:00 AM

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


Henning Schmiedehausen added a comment - 27/Jan/07 12:12 PM

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


Vincent Siveton added a comment - 16/Feb/07 05:05 AM

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)
...

Jason van Zyl added a comment - 18/Mar/07 12:20 AM

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


Henning Schmiedehausen added a comment - 07/Apr/07 05:52 AM

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.


Henning Schmiedehausen added a comment - 07/Apr/07 03:42 PM

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.


Henning Schmiedehausen added a comment - 07/Apr/07 03:43 PM

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.


Henning Schmiedehausen added a comment - 08/Apr/07 06:39 AM

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.


Jason van Zyl added a comment - 28/May/07 12:58 PM

Tests now pass and seem fine.


Jason van Zyl added a comment - 28/May/07 12:58 PM

Patch applied.