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

Fix #134 when missingFileUrl contains more lines #276

Merged
merged 1 commit into from
Feb 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
org.json--json--20070829=The JSON License by file url
org.json--json--20070829=The JSON License by file url
javax.resource--connector-api--1.5=CDDL + GPLv2 with classpath exception by file url
5 changes: 5 additions & 0 deletions src/it/add-third-party-missing-file/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
<artifactId>json</artifactId>
<version>20070829</version>
</dependency>
<dependency>
<groupId>javax.resource</groupId>
<artifactId>connector-api</artifactId>
<version>1.5</version>
</dependency>
</dependencies>

<build>
Expand Down
4 changes: 3 additions & 1 deletion src/it/add-third-party-missing-file/postbuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ file = new File(basedir, 'target/generated-sources/license/THIRD-PARTY-by-classp
assert file.exists();
content = file.text;
assert content.contains('The JSON License by classpath url');
assert content.contains('CDDL + GPLv2 with classpath exception by classpath url');

file = new File(basedir, 'target/generated-sources/license/THIRD-PARTY-by-file.txt');
assert file.exists();
content = file.text;
assert content.contains('The JSON License by file url');
assert content.contains('The JSON License by file url');
assert content.contains('CDDL + GPLv2 with classpath exception by file url');
6 changes: 4 additions & 2 deletions src/it/add-third-party-missing-file/prebuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ import java.util.jar.JarOutputStream;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;

JarOutputStream licenseRepo = new JarOutputStream(new FileOutputStream(new File(basedir, "license-repo.jar")));
String missingLicences = "org.json--json--20070829=The JSON License by classpath url\n" +
"javax.resource--connector-api--1.5=CDDL + GPLv2 with classpath exception by classpath url";

JarOutputStream licenseRepo = new JarOutputStream(new FileOutputStream(new File(basedir, "license-repo.jar")));
licenseRepo.putNextEntry(new ZipEntry("missing-licenses.properties"));
licenseRepo.write("org.json--json--20070829=The JSON License by classpath url".getBytes("UTF-8"));
licenseRepo.write(missingLicences.getBytes("UTF-8"));
licenseRepo.closeEntry();

licenseRepo.close();
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ else if ( licenseMergesUrl != null )
getLog().warn( "" );
if ( UrlRequester.isStringUrl( licenseMergesUrl ) )
{
licenseMerges = Arrays.asList( UrlRequester.getFromUrl( licenseMergesUrl ) );
licenseMerges = Arrays.asList( UrlRequester.getFromUrl( licenseMergesUrl ).split( "\n" ) );
}
}

Expand Down