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

Fail to download license file because license name contains invalid character #560

Open
nhuongmh opened this issue Apr 17, 2024 · 0 comments · May be fixed by #561
Open

Fail to download license file because license name contains invalid character #560

nhuongmh opened this issue Apr 17, 2024 · 0 comments · May be fixed by #561
Labels

Comments

@nhuongmh
Copy link

Hi,
I was trying to download all license files using mvn license:download-licenses but there is an error throw because the file name that going to be saved contains illegal character spdx-license-identifier: mit - mit.html. We should replace all illegal characters for file name before before write content to file.

Configuration

<plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>license-maven-plugin</artifactId>
      <version>2.4.0</version>
      <executions>
          <execution>
              <id>default</id>
              <configuration>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                  <thirdPartyFilename>THIRD-PARTY.txt</thirdPartyFilename>
                  <verbose>true</verbose>
              </configuration>
          </execution>
      </executions>
  </plugin>

Error:

[DEBUG] Downloading license(s) for project com.github.oshi:oshi-core-java11
[DEBUG] About to download 'https://opensource.org/licenses/MIT'
[DEBUG] Downloading 'https://opensource.org/licenses/MIT' -> 'C:\Users\username\git\projectx\target\generated-resources\licenses\spdx-license-identifier: mit - mit.html'
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  20.418 s
[INFO] Finished at: 2024-04-17T15:44:45+07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:license-maven-plugin:2.4.0:download-licenses (default-cli) on project projectx: Execution default-cli of goal org.codehaus.mojo:license-maven-plugin:2.4.0:download-licenses failed: Illegal char <:> at index 135: C:\Users\username\git\projectx\target\generated-resources\licenses\spdx-license-identifier: mit - mit.html -> [Help 1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants