Build NPM Proxy Server on Nexus OSS 3.21

I had good experience with Nexus OSS 2.x and it was very easy to use. Based on it, the team built up Maven proxy server and Java private repository. The server had been served for many years and it helped team to finish thousands of builds without any problem.

To have better NPM repository support, it’s time to upgrade to a newer version of Nexus. Compared with JFrog’s Artifactory OSS, NPM and Gradle repository support is included in Nexus OSS version already.

Installation

The latest Nexus OSS version can be download from here. Unzip it and go to /bin folder to start it. I am using Windows 10, so Nexus OSS can be installed as a Windows Service. Then you can start/stop the Nexus OSS server in Services Management.

When server starts, you can access the web page, default is http://localhost:8081.

Note: For the first time run, there needs to update the admin user’s password. Follow the instructions to finish it.

Create NPM repository

By default, there are Maven repo (can be used by Gradle as well) and NuGet repo. To have a NPM repo, you need to manually create it.

Use “admin” to log into Nexus, Open “Repositories” page and click “Create repository“.

Select “npm proxy” in the Recipe list,

Put a name of the repository, such as “npm-all” and the “remote storage”.

Click “Create repository” to finish the creation. Now a npm proxy server is ready for serving. The repo URL is http://localhost:8081/repository/npm-all/.

NPM and Yarn Configuration

For npm and yarn, you can use the following commands to use this proxy server respectively.

All done!

Build OpenJFX 8 in CentOS 6.7 Docker Container

OpenJDK 8 doesn’t include OpenJFX by default. And to make OpenJFX work on old Linux distribution, such as CentOS 6.7, you can not simply follow the official instructions. This article will talk about how to build OpenJFX 8 in CentOS 6.7 docker container.

Start docker container

With docker, it’s extremely easy to get CentOS 6.7 environment.

Instructions

Yum Install Packages


Install GCC/G++ 6, Python 2.7, Ruby 2.4

Reference is https://www.softwarecollections.org/en/scls/rhscl/devtoolset-6/.


Install Gradle, CMake, Ant

Install gradle 4.8 and ant 1.10, update $PATH.


Sync OpenJFX 8 source code

Build without Webkit

Skip the samples and scene-builder build – “vim rt/build.gradle” and comment on the following lines

Start Gradle build.


when the build is done, the javafxsdk-overlay.zip will be generated.


Build with Webkit

With WebKit, the compilation will become extremely slow.

Before doing the steps of “Build without Webkit”, do the following extra steps.

Copy the gradle.properties from the template and enable the Webkit compiling

Enable “COMPILE_WEBKIT“, “BUILD_JAVADOC“, “BUILD_SRC_ZIP“, And specify COMPILE_TARGETS as “linux”

Update buildSrc/linux.gradle a little bit.


Update the symbolic link of /usr/bin/python2

Do the steps of “Build without Webkit“.