Maven 2.x Project Info Reports Plugin

some reports have inconsistent line ending style

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.1.2
  • Fix Version/s: None
  • Component/s: dependencies, project-team
  • Labels:
    None
  • Environment:
    Windows
  • Number of attachments :
    0

Description

Some of the reports generated by the plugin have inconsistent line ending style. I have marked dependency and team-list components as affected by probably other components can produce inconsistent line endings too.

I am working on Windows so it is (somewhat) expected that files generated by the plugin will have the CRLF line ending, but some files will have a mixed line ending style due to different reasons.

The plugin should enforce consistent line ending style in the output files. It is possible that this issue is not caused by the plugin itself but "inherited" from some of its dependencies that handle generic maven reporting functionality, in this case please move the issue to the appropriate maven component.

Examples:

team-list.html
The following code fragment near the end of the file seems to always have the LF line endings:

<script type="text/javascript">
function offsetDate(id, offset) {
    var now = new Date();
    var nowTime = now.getTime();
    var localOffset = now.getTimezoneOffset();
    var developerTime = nowTime + ( offset * 60 * 60 * 1000 )+ ( localOffset * 60 * 1000 );
    var developerDate = new Date(developerTime);

    document.getElementById(id).innerHTML = developerDate;
}

function init(){
}

window.onLoad = init();
</script>

This code is probably copied to the resulting report page from some string literal with hard-coded line ending.

dependencies.html
The dependency report contains a dependency tree that has an "I" icon that unhides a description of a particular dependency. The description text is obtained from somewhere (the dependency pom?) and copied to the dependencies.html as is, including its line ending style.

For example, org.antlr:stringtemplate:jar:3.2 and antlr:antlr:jar:2.7.7 dependencies have a description that uses LF line endings. When these artifacts are required either directly or indirectly then the project's dependencies.html will contain both CRLF for generated code and LF for copy-pasted descriptions.
Check the http://maven-svn-wagon.googlecode.com/svn/site/dependencies.html, lines 450-464 for the specific example.

Issue Links

Activity

Hide
Jerome Lacoste added a comment -

First problem is in ./src/main/java/org/apache/maven/report/projectinfo/TeamListReport.java

public void renderBody()
{

(hardcoded \n)

See also src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java

with the hardcoded JAVASCRIPT instance

As for the dependency description:

See
private void printDescriptionsAndURLs( DependencyNode node, String uid )

but there I am not sure if the sink should be responsible for converting the \n or if the input should be sanitized before being sent as a parameter.

Show
Jerome Lacoste added a comment - First problem is in ./src/main/java/org/apache/maven/report/projectinfo/TeamListReport.java public void renderBody() { (hardcoded \n) See also src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java with the hardcoded JAVASCRIPT instance As for the dependency description: See private void printDescriptionsAndURLs( DependencyNode node, String uid ) but there I am not sure if the sink should be responsible for converting the \n or if the input should be sanitized before being sent as a parameter.
Hide
Jerome Lacoste added a comment -

MPIR-35 would fix most of the small points in that issue.

Show
Jerome Lacoste added a comment - MPIR-35 would fix most of the small points in that issue.
Hide
Olivier Lamy added a comment -

fixed in rev 907820

Show
Olivier Lamy added a comment - fixed in rev 907820

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: