[java-idp-plugin-scripting] 01/03: JSPT-95 Ship GraalVM jars, do not download them.
Rod Widdowson
rdw at steadingsoftware.com
Sun Oct 4 10:58:41 UTC 2020
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch main
in repository java-idp-plugin-scripting.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-scripting.git;a=commit;h=cbee5e5d3706457ad036e4eda3cd38d5d6b0b889
commit cbee5e5d3706457ad036e4eda3cd38d5d6b0b889
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sun Oct 4 11:41:23 2020 +0100
JSPT-95 Ship GraalVM jars, do not download them.
https://issues.shibboleth.net/jira/browse/JSPT-95
---
nashorn-impl/pom.xml | 97 ++++++++++++----------
.../plugin/scripting/nashorn/NashornPlugin.java | 40 +--------
.../idp/plugin/scripting/rhino/RhinoPlugin.java | 5 --
3 files changed, 53 insertions(+), 89 deletions(-)
diff --git a/nashorn-impl/pom.xml b/nashorn-impl/pom.xml
index afefd68..486cec3 100644
--- a/nashorn-impl/pom.xml
+++ b/nashorn-impl/pom.xml
@@ -27,63 +27,24 @@
</description>
<dependencies>
- <!-- All dependencies except the api and the dependencies of graal
- (NOT GRAAL itself) are provided and test -->
- <dependency>
- <groupId>net.shibboleth.idp.plugin.scripting</groupId>
- <artifactId>idp-plugin-scripting-api</artifactId>
- <version>0.1.4-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>${slf4j.groupId}</groupId>
- <artifactId>slf4j-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>net.shibboleth.idp</groupId>
- <artifactId>idp-admin-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>net.shibboleth.utilities</groupId>
- <artifactId>java-support</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>net.shibboleth.ext</groupId>
- <artifactId>spring-extensions</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>${spring.groupId}</groupId>
- <artifactId>spring-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>${spring.groupId}</groupId>
- <artifactId>spring-beans</artifactId>
- <scope>provided</scope>
- </dependency>
+ <!-- All dependencies except the api, GraalVM and it's dependencies are provided or test -->
+ <!-- Compiled - GraalVM -->
<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
- <scope>provided</scope>
+ <scope>compile</scope>
<version>${graalvm.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js</artifactId>
<version>${graalvm.version}</version>
- <scope>provided</scope>
+ <scope>compile</scope>
</dependency>
+ <!-- Runtime - GraalVM dependencies -->
+
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
@@ -121,6 +82,52 @@
<scope>runtime</scope>
</dependency>
+ <!-- Provided - IdP and its dependencies. -->
+
+ <dependency>
+ <groupId>net.shibboleth.idp.plugin.scripting</groupId>
+ <artifactId>idp-plugin-scripting-api</artifactId>
+ <version>0.1.4-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>${slf4j.groupId}</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.shibboleth.idp</groupId>
+ <artifactId>idp-admin-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.shibboleth.utilities</groupId>
+ <artifactId>java-support</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.shibboleth.ext</groupId>
+ <artifactId>spring-extensions</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>${spring.groupId}</groupId>
+ <artifactId>spring-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>${spring.groupId}</groupId>
+ <artifactId>spring-beans</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- TEST -->
+
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
diff --git a/nashorn-impl/src/main/java/net/shibboleth/idp/plugin/scripting/nashorn/NashornPlugin.java b/nashorn-impl/src/main/java/net/shibboleth/idp/plugin/scripting/nashorn/NashornPlugin.java
index d028ea8..bd0e15b 100644
--- a/nashorn-impl/src/main/java/net/shibboleth/idp/plugin/scripting/nashorn/NashornPlugin.java
+++ b/nashorn-impl/src/main/java/net/shibboleth/idp/plugin/scripting/nashorn/NashornPlugin.java
@@ -18,7 +18,6 @@
package net.shibboleth.idp.plugin.scripting.nashorn;
import java.io.IOException;
-import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Path;
import java.util.List;
@@ -29,12 +28,8 @@ import org.slf4j.LoggerFactory;
import net.shibboleth.idp.plugin.AbstractIdPPlugin;
import net.shibboleth.idp.plugin.PluginVersion;
import net.shibboleth.idp.plugin.scripting.Version;
-import net.shibboleth.utilities.java.support.collection.Pair;
-/**
- * Details about the nashorn scripting plugin
- *
- */
+/**Details about the nashorn scripting plugin. */
public class NashornPlugin extends AbstractIdPPlugin {
static final String GRAAL_VERSION = "20.0.0";
@@ -66,39 +61,6 @@ public class NashornPlugin extends AbstractIdPPlugin {
new URL("https://git.shibboleth.net/view/?p=java-idp-plugin-scripting.git;a=blob_plain;f=src/resources/main/plugins.props;hb=HEAD"));
}
- /** Create a {@link Pair } as needed.
- * @param dirPath dir part of the coordinates (no version)
- * @param jar the name name (no version)
- * @param parent where to make the path relative to
- * @return an appropriare pair
- * @throws MalformedURLException if the URL comes up wrong
- */
- private Pair<URL,Path> downloadPair(final String dirPath, final String jar, final Path parent) throws MalformedURLException {
- // example graal-sdk-20.0.0.jar
- final String jarName = new StringBuilder(jar)
- .append('-')
- .append(GRAAL_VERSION)
- .append(".jar")
- .toString();
- // example https://repo1.maven.org/maven2/org/graalvm/sdk/graal-sdk/20.0.0/graal-sdk-20.0.0.jar
- final URL url = new URL(new StringBuilder(MAVEN_REPO)
- .append(dirPath)
- .append(GRAAL_VERSION)
- .append('/')
- .append(jarName)
- .toString());
- return new Pair<URL, Path>(url, parent.resolve(jarName));
- }
-
- @Override
- public List<Pair<URL, Path>> getExternalFilePathsToCopy() throws IOException {
- final Path to = Path.of("dist", "edit-webapp-" + getPluginId(), "WEB-INF", "lib");
- return List.of(downloadPair("org/graalvm/sdk/graal-sdk/", "graal-sdk", to),
- downloadPair("org/graalvm/js/js/", "js", to),
- downloadPair("org/graalvm/regex/regex/", "regex", to),
- downloadPair("org/graalvm/truffle/truffle-api/", "truffle-api", to));
- }
-
@Override
public List<Path> getFilePathsToCopy() {
return List.of(Path.of("doc", "net.shibboleth.idp.plugin.scripting.nashorn-license.txt"),
diff --git a/rhino-impl/src/main/java/net/shibboleth/idp/plugin/scripting/rhino/RhinoPlugin.java b/rhino-impl/src/main/java/net/shibboleth/idp/plugin/scripting/rhino/RhinoPlugin.java
index e60528c..9fe5c3c 100644
--- a/rhino-impl/src/main/java/net/shibboleth/idp/plugin/scripting/rhino/RhinoPlugin.java
+++ b/rhino-impl/src/main/java/net/shibboleth/idp/plugin/scripting/rhino/RhinoPlugin.java
@@ -64,11 +64,6 @@ public class RhinoPlugin extends AbstractIdPPlugin {
new URL("https://git.shibboleth.net/view/?p=java-idp-plugin-scripting.git;a=blob_plain;f=src/resources/main/plugins.props;hb=HEAD"));
}
- @Override
- public List<Pair<URL, Path>> getExternalFilePathsToCopy() throws IOException {
- return Collections.emptyList();
- }
-
@Override
public List<Path> getFilePathsToCopy() {
return List.of(Path.of("doc", "net.shibboleth.idp.plugin.scripting.rhino-license.txt"),
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list