Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links in aggregate-third-party-report.html point to third-party-report.html #213

Closed
digulla opened this issue Jan 18, 2019 · 5 comments
Closed

Comments

@digulla
Copy link

digulla commented Jan 18, 2019

When creating an aggregated report with license:aggregate-third-party-report, the resulting file contains links to the (non existing) file third-party-report.html

Either fix the name of the file or use relative links (i.e #Overview instead of third-party-report.html#Overview).

@ppalaga
Copy link
Contributor

ppalaga commented Jan 18, 2019

A pull request, ideally with an integration test would be welcome.

@digulla
Copy link
Author

digulla commented Jan 24, 2019

The fix is probably just changing one line in license-maven-plugin\src\main\java\org\codehaus\mojo\license\ThirdPartyReportRenderer.java:

    sink.link( "./third-party-report.html#" + getText( "report.overview.title" ) );

to

    sink.link( "#" + getText( "report.overview.title" ) );

I checked out the project and could compile it ./mvnw clean install but I can't run it with Maven 3.6:

Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.maven.artifact.repository.ArtifactRepository
    at org.apache.maven.project.artifact.DefaultMavenMetadataCache.repositoriesHashCode (DefaultMavenMetadataCache.java:155)
    at org.apache.maven.project.artifact.DefaultMavenMetadataCache.access$100 (DefaultMavenMetadataCache.java:43)
    at org.apache.maven.project.artifact.DefaultMavenMetadataCache$CacheKey.<init> (DefaultMavenMetadataCache.java:80)
    at org.apache.maven.project.artifact.DefaultMavenMetadataCache.newCacheKey (DefaultMavenMetadataCache.java:340)
    at org.apache.maven.project.artifact.DefaultMavenMetadataCache.get (DefaultMavenMetadataCache.java:307)
    at org.apache.maven.project.artifact.MavenMetadataSource.retrieve (MavenMetadataSource.java:157)
    at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.recurse (DefaultLegacyArtifactCollector.java:551)
    at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.collect (DefaultLegacyArtifactCollector.java:148)
    at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:504)
    at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveWithExceptions (DefaultArtifactResolver.java:358)
    at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively (DefaultArtifactResolver.java:352)
    at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively (DefaultArtifactResolver.java:324)
    at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively (DefaultArtifactResolver.java:287)
    at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively (DefaultArtifactResolver.java:261)
    at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively (DefaultArtifactResolver.java:298)
    at org.codehaus.mojo.license.api.DefaultDependenciesTool.resolve (DefaultDependenciesTool.java:497)
    at org.codehaus.mojo.license.api.DefaultDependenciesTool.loadProjectArtifacts (DefaultDependenciesTool.java:444)
    at org.codehaus.mojo.license.AbstractThirdPartyReportMojo.createThirdPartyDetails (AbstractThirdPartyReportMojo.java:555)
    at org.codehaus.mojo.license.AggregatorThirdPartyReportMojo.createThirdPartyDetails (AggregatorThirdPartyReportMojo.java:127)
    at org.codehaus.mojo.license.AbstractThirdPartyReportMojo.executeReport (AbstractThirdPartyReportMojo.java:361)

so I'm stuck.

@ppalaga
Copy link
Contributor

ppalaga commented Jan 24, 2019

I can't run it with Maven 3.6

If "run" means that you have a sample project on which you run your freshly built SNAPSHOT of the plugin, then I recommend to transform your sample project into an integration test under https://github.com/mojohaus/license-maven-plugin/tree/master/src/it and create a pull request. Then somebody will be able to reproduce your problem and maybe he can also help to solve it.

digulla pushed a commit to digulla/license-maven-plugin that referenced this issue Jan 25, 2019
@digulla
Copy link
Author

digulla commented Jan 25, 2019

I'm not entirely happy with the PR; I had to change / fix too much other stuff to make the new test run. But since many people report that the report Mojo also fails for them because of ClassNotFound, maybe you should merge both fixes.

@digulla
Copy link
Author

digulla commented Jan 28, 2019

How can I write an IT which depends on Maven 3.6?

@ppalaga ppalaga closed this as completed in 53274c9 Feb 1, 2019
ppalaga added a commit that referenced this issue Feb 1, 2019
Fix #213 Links in aggregate-third-party-report.html point to
@ppalaga ppalaga added this to the 1.17 milestone Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants