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

add-third-party fails on Windows with version 2.5.0 #615

Open
vbode opened this issue Dec 5, 2024 · 8 comments
Open

add-third-party fails on Windows with version 2.5.0 #615

vbode opened this issue Dec 5, 2024 · 8 comments

Comments

@vbode
Copy link

vbode commented Dec 5, 2024

We get this error when running the licence checker:
[ERROR] Failed to execute goal org.codehaus.mojo:license-maven-plugin:2.5.0:add-third-party (verify-third-party-licenses) on project testwebapp: could not init goal AddThirdPartyMojo for reason : Illegal character in path at index 10: file:///C:\Repositories\build\testwebapp\target/artifact-filters.txt -> [Help 1]

The error does not occur on our linux build servers or in my WSL, but it does occur on Windows since version 2.5.0. Version 2.4.0 is fine.

@slawekjaranowski
Copy link
Member

can you provide your configuration which cause such error,
we can add it as integration tests

@vbode
Copy link
Author

vbode commented Dec 9, 2024

@slawekjaranowski
Here's an example pom with which to reproduce the issue.
You will need to place a dummy file 'artifact-filters.txt' in your target folder.
pom.zip

@vbode
Copy link
Author

vbode commented Jan 20, 2025

@slawekjaranowski, just wondering if you have had time to reproduce the issue with my provided example pom.

@spyro2000
Copy link

Failing for me also. My config looks like

 <configuration>
                    <licenseName>project_license</licenseName>
                    <includedLicenses>file:${project.basedir}/build/license/compliance-license.txt</includedLicenses>
                    <licenseMergesUrl>file:${project.basedir}/build/license/merge-license.txt</licenseMergesUrl>
                    <missingFile>${project.basedir}/build/license/third-party-missing.properties</missingFile>
                    <fileTemplate>${project.basedir}/build/license/third-party-file-template.ftl</fileTemplate>
                    <outputDirectory>${project.basedir}/target/generated-sources/license</outputDirectory>
                    <thirdPartyFilename>license_${project.artifactId}.csv</thirdPartyFilename>
                    <excludedGroups>com.my.group.*</excludedGroups>
                    <includeTransitiveDependencies>true</includeTransitiveDependencies>
                    <failOnBlacklist>true</failOnBlacklist>
                    <failOnMissing>true</failOnMissing>
                </configuration>

2.4.0 worked.

@slawekjaranowski
Copy link
Member

can you try to change: file:${project.basedir} to ${project.baseUri}

@vbode
Copy link
Author

vbode commented Feb 17, 2025

I modified:
file:///${project.build.directory}/artifact-filters.txt

To:
${project.baseUri}/target/artifact-filters.txt

And that seems to fix it indeed.

@spyro2000
Copy link

Hi there,

do I have to change all other pathes also to this format or should I just wait for a fix? Thank you.

@slawekjaranowski
Copy link
Member

I propose to change configuration today ....

Next we should discover what format and data such field should have
and fix - clarify documentation

eg now we have that includedLicenses can contain a URL .... not URI ....
https://www.mojohaus.org/license-maven-plugin/add-third-party-mojo.html#includedLicenses

even more docs excludedLicenses has example with includedLicenses 😄
https://www.mojohaus.org/license-maven-plugin/add-third-party-mojo.html#excludedLicenses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants