Skip to content

Commit

Permalink
Merge pull request #276 from nfalco79/feature/134
Browse files Browse the repository at this point in the history
Fix #134 when missingFileUrl contains more lines
  • Loading branch information
ppalaga authored Feb 21, 2019
2 parents 716722e + 9f04f1f commit 98e90b6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
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

0 comments on commit 98e90b6

Please sign in to comment.