Skip to content

nanobox-io/nanobox-engine-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java

This is a Java engine used to launch Java apps on Nanobox.

Usage

To use the Java engine, specify java as your engine in your boxfile.yml.

run.config:
  engine: java

Build Process

When running a build, this engine compiles code by doing the following:

Maven (you can customize with the compile option in the maven settings:

  • mvn -B -DskipTests=true clean install

Gradle (you can customize with the compile option in the gradle settings):

  • gradle build

Basic Configuration Options

This engine exposes configuration options through the boxfile.yml, a yaml config file used to provision and configure your app's infrastructure when using Nanobox.

Overview of Basic Boxfile Configuration Options

run.config:
  engine.config:
    # Java Settings
    runtime: oracle-jdk8

    # Maven Settings
    maven_version: '3.3'
    
    # Gradle Settings
    gradle_version: '4.2'

    # Node.js Settings
    nodejs_runtime: nodejs-4.4
Quick Links

Java Settings
Maven Settings
Gradle Settings
Node.js Settings


Java Settings

The following setting allows you to define your Java runtime environment.


runtime

Specifies which Java runtime and version to use. The following runtimes are available:

  • openjdk7
  • openjdk8
  • oracle-jdk8 (default)
  • sun-jdk6
  • sun-jdk7
  • sun-jdk8
run.config:
  engine.config:
    runtime: openjdk8

Maven Settings

The following setting allows you to configure Maven to your specific needs.


maven_version

Defines which version of Maven to use. Available versions depend on which version of Java you're using.

Java 6
  • 3.0
  • 3.1
  • 3.2
Java 7
  • 3.0
  • 3.1
  • 3.2
  • 3.3

Java 8

  • 3.0
  • 3.1
  • 3.2
  • 3.3
run.config:
  engine.config:
    maven_version: '3.3'

compile

Define a custom build command. Useful if you need to do something other than the default mvn -T 4.0C -B -DskipTests=true clean install like mvn package.

run.config:
  engine.config:
    maven_version: '3.3'
    compile: 'mvn clean package'

Gradle Settings

If you want to use the Gradle build tool, you can configure which version you want to use. The following settings are valid:

gradle_version

Defines which version of Gradle to use from the distribution list.

run.config:
  engine.config:
    gradle_version: '4.2'

compile

Define a custom build command. Useful if you need to do something other than the default gradle build like gradle shadowJar.

run.config:
  engine.config:
    gradle_version: '4.2'
    compile: 'gradle shadowJar'

Node.js Settings

Many applications utilize Javascript tools in some way. This engine allows you to specify which Node.js runtime you'd like to use.


nodejs_runtime

Specifies which Node.js runtime and version to use. You can view the available Node.js runtimes in the Node.js engine documentation.

run.config:
  engine.config:
    nodejs_runtime: nodejs-4.4

Help & Support

This is a Java engine provided by Nanobox. If you need help with this engine, you can reach out to us in the Nanobox Slack channel (access can be requested at slack.nanoapp.io). If you are running into an issue with the engine, feel free to create a new issue on this project.