Skip to content

Commit

Permalink
Merge pull request #8 from timja/upgrade-groovy-smaller
Browse files Browse the repository at this point in the history
Upgrade groovy version
  • Loading branch information
jglick committed Jan 30, 2021
2 parents 199e46e + 1a439fb commit 3f417d2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
12 changes: 10 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>1.6.5</version>
<artifactId>groovy-xml</artifactId>
<version>3.0.7</version>
</dependency>
</dependencies>

Expand All @@ -67,6 +67,14 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
19 changes: 15 additions & 4 deletions src/main/java/com/cloudbees/maven/license/ProcessMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
Expand Down Expand Up @@ -146,11 +147,21 @@ public void execute() throws MojoExecutionException {
}
}

if (generateLicenseXml!=null)
comp.add((LicenseScript) shell.parse(getClass().getResourceAsStream("xmlgen.groovy"),"xmlgen.groovy"));
if (generateLicenseXml!=null) {
try {
comp.add((LicenseScript) shell.parse(getClass().getResource("xmlgen.groovy").toURI()));
} catch (URISyntaxException | IOException e) {
throw new MojoExecutionException("Failed to retrieve xmlgen.groovy", e);
}
}

if (generateLicenseHtml!=null)
comp.add((LicenseScript) shell.parse(getClass().getResourceAsStream("htmlgen.groovy"),"htmlgen.groovy"));
if (generateLicenseHtml!=null) {
try {
comp.add((LicenseScript) shell.parse(getClass().getResource("htmlgen.groovy").toURI()));
} catch (URISyntaxException | IOException e) {
throw new MojoExecutionException("Failed to retrieve htmlgen.groovy", e);
}
}

if (inlineScript!=null)
comp.add((LicenseScript)shell.parse(inlineScript,"inlineScript"));
Expand Down

0 comments on commit 3f417d2

Please sign in to comment.