Closed wikier closed 8 years ago
Thanks! Could you please explain how I can test this?
Easy @RubenVerborgh:
mvn clean package
That would generate a target/client-js-1.1.5-SNAPSHOT.jar
file bundling the library.
The trick webjars uses is actually quite simple: with any Servlet 3 compatible container, the WebJars that are in the WEB-INF/lib
directory are automatically made available as static resources. This works because anything in a META-INF/resources
directory in a JAR in WEB-INF/lib
is automatically exposed as a static resource. And then you can normally use it:
<link rel="stylesheet" href="webjars/org.linkeddatafragments.client-js/1.1.5-SNAPSHOT/triple-pattern-fragments/FragmentsClient.js" />
We can customize some of those paths, that quite easy to do in the pom.xml
file.
And how can I run the generated JAR? Because the original code is written for Node.js, so I'd want to see whether it works outside of Node.
In any maven-based webapp, just add the dependency:
<dependency>
<groupId>org.linkeddatafragments</groupId>
<artifactId>client-js</artifactId>
<version>1.1.5-SNAPSHOT</version>
</dependency>
I have to admit I have not so much experience with Node.js, but we'll figure out how.
I still need to check if the js dependencies work in that style, because I'd prefer to add dependencies to the webjars instead on bundling all together.
Okay. Thanks for the work—if you find how to run/test this JAR easily, I'll merge it.
Yes, keep it on hold until I'll test it well.
I early opened this PR more for triggering the discussion.
:+1:
Closing this for now, given the age of this discussion. Feel free to reopen if there's any news.
WebJars are client-side web libraries packaged into JAR (Java Archive) files.
This new feature would allow any JavaEE application (using Servlet API >= 3.0) to easily user the LDF Javascript client.
The background of this PR is the support we're including in Apache Marmotta. This, in combination with having the artifact available from Maven Central due ASF rules (I can also help on that), would make the integration quite easy for us.