I'm creating a web application with Spring backend and a React frontend. Its configuration is based on this minimal Spring Boot/React project.
Now I want to use the react-checkbox-tree component in this project.
How can I do it?
I tried two different things.
Attempt 1
In the pom.xml file the React module is included using the following declaration:
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>react</artifactId>
<version>15.6.1</version>
</dependency>
I tried to find such artifact for the tree component, but couldn't.
Attemp 2
I tried to install the tree component as a global module (npm install -g react-checkbox-tree
).
It didn't help. I get the error
[INFO] ERROR in ./src/main/js/app.js
[INFO] Module not found: Error: Cannot resolve module 'react-checkbox-tree' in C:\myproject\src\main\js
[INFO] @ ./src/main/js/app.js 5:25-55
during build.
Update 1 (13.08.2017 23:57):
On the WebJars homepage I found a tutorial on how to package a Node module as a WebJar (so that it can be integrated into Spring Boot project like a normal Maven dependency). I started to create the WebJar project for react-checkbox-tree.
You can find the source code here.
Currently the problem is the UPSTREAM_ZIP_URL
mentioned in the pom.xml
in the
tutorial:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<upstream.url>UPSTREAM_ZIP_URL</upstream.url>
I looked at the code of the React WebJar and came to the conclusion that for
react-checkbox-tree
, v. 0.6.4, UPSTREAM_ZIP_URL
must be https://unpkg.com/react-checkbox-tree@0.6.4/dist
. However, I don't find
anything at this location. But there are some files at https://unpkg.com/react-checkbox-tree@0.6.4/.
I would appreciate, if someone answered the following questions:
- Can I assume that in this case,
UPSTREAM_ZIP_URL
is equal to https://unpkg.com/react-checkbox-tree@0.6.4/lib/? - How can I build this web JAR project or submit it to WebJars.org?