diff --git a/src/it/aggregate-third-party-report/child1/pom.xml b/src/it/aggregate-third-party-report/child1/pom.xml new file mode 100644 index 000000000..16ab34215 --- /dev/null +++ b/src/it/aggregate-third-party-report/child1/pom.xml @@ -0,0 +1,49 @@ + + + + + + 4.0.0 + + + org.codehaus.mojo.license.test + test-aggregate-third-party-report + @pom.version@ + + test-aggregate-third-party-report-child1 + + License Test :: aggregate-third-party-report - child 1 + + + + commons-logging + commons-logging + 1.1.1 + + + + + + diff --git a/src/it/aggregate-third-party-report/child2/pom.xml b/src/it/aggregate-third-party-report/child2/pom.xml new file mode 100644 index 000000000..b8ef6d4a1 --- /dev/null +++ b/src/it/aggregate-third-party-report/child2/pom.xml @@ -0,0 +1,50 @@ + + + + + + 4.0.0 + + + org.codehaus.mojo.license.test + test-aggregate-third-party-report + @pom.version@ + + test-aggregate-third-party-report-child2 + + License Test :: aggregate-third-party-report - child 2 + + + + junit + junit + 4.8.1 + test + + + + + + diff --git a/src/it/aggregate-third-party-report/invoker.properties b/src/it/aggregate-third-party-report/invoker.properties new file mode 100644 index 000000000..4c3f0de5c --- /dev/null +++ b/src/it/aggregate-third-party-report/invoker.properties @@ -0,0 +1,23 @@ +### +# #%L +# License Maven Plugin +# %% +# Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit +# %% +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Lesser Public License for more details. +# +# You should have received a copy of the GNU General Lesser Public +# License along with this program. If not, see +# . +# #L% +### +invoker.goals=clean license:aggregate-third-party-report +invoker.failureBehavior=fail-fast \ No newline at end of file diff --git a/src/it/aggregate-third-party-report/pom.xml b/src/it/aggregate-third-party-report/pom.xml new file mode 100644 index 000000000..8456ae051 --- /dev/null +++ b/src/it/aggregate-third-party-report/pom.xml @@ -0,0 +1,65 @@ + + + + + + 4.0.0 + + org.codehaus.mojo.license.test + test-aggregate-third-party-report + @pom.version@ + + + child1 + child2 + + + License Test :: aggregate-third-party-report + + pom + + + + UTF-8 + true + true + + + + + + + + org.codehaus.mojo + license-maven-plugin + @pom.version@ + + + + + + + + diff --git a/src/it/aggregate-third-party-report/postbuild.groovy b/src/it/aggregate-third-party-report/postbuild.groovy new file mode 100644 index 000000000..9be3ea257 --- /dev/null +++ b/src/it/aggregate-third-party-report/postbuild.groovy @@ -0,0 +1,35 @@ +/* + * #%L + * License Maven Plugin + * %% + * Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * . + * #L% + */ + +file = new File(basedir, 'target/site/aggregate-third-party-report.html'); +assert file.exists(); +content = file.text; +assert !content.contains('the project has no dependencies.'); +assert !content.contains('/third-party-report.html#'); +assert content.contains('commons-logging:commons-logging:1.1.1'); +assert content.contains('The Apache Software License, Version 2.0'); // TODO Should be a link +assert content.contains('Back to top'); + +file = new File(basedir, 'target/site/third-party-report.html'); +assert !file.exists(); + +return true; diff --git a/src/main/java/org/codehaus/mojo/license/AbstractLicenseReportRenderer.java b/src/main/java/org/codehaus/mojo/license/AbstractLicenseReportRenderer.java index baf033347..ceca104b0 100644 --- a/src/main/java/org/codehaus/mojo/license/AbstractLicenseReportRenderer.java +++ b/src/main/java/org/codehaus/mojo/license/AbstractLicenseReportRenderer.java @@ -217,7 +217,7 @@ else if ( details.hasThirdPartyLicenses() ) sink.tableCell(); String gav = getGAV( details ); - sink.link( "./third-party-report.html#" + gav ); + sink.link( "#" + gav ); sink.text( gav ); sink.link_(); diff --git a/src/main/java/org/codehaus/mojo/license/ThirdPartyReportRenderer.java b/src/main/java/org/codehaus/mojo/license/ThirdPartyReportRenderer.java index 15f0f2090..a7927b1f0 100644 --- a/src/main/java/org/codehaus/mojo/license/ThirdPartyReportRenderer.java +++ b/src/main/java/org/codehaus/mojo/license/ThirdPartyReportRenderer.java @@ -261,7 +261,7 @@ private void renderThirdPartyDetail( ThirdPartyDetails detail ) sink.sectionTitle2_(); renderThirdPartyDetailTable( detail ); - sink.link( "./third-party-report.html#" + getText( "report.overview.title" ) ); + sink.link( "#" + getText( "report.overview.title" ) ); sink.text( getText( "report.back.to.top.page" ) ); sink.link_(); sink.lineBreak();