How to set JAVA_HOME with Maven appassembler-maven-plugin

ʻWhen automatically generating a script using appassembler-maven-plugin`, I made it possible to set JAVA_HOME in the automatically generated script, so make a note.


First, prepare that describes the export settings of JAVA_HOME as a preliminary preparation.

export JAVA_HOME=/usr/java/jdk1.8.0_152

Next, set assembler so that can be called from the automatically generated script. Official document has a parameter called ʻenvironmentSetupFileName`, so use this.


・ ・ ・ Omitted ・ ・ ・
・ ・ ・ The following is omitted ...

The that is automatically generated when youmvn package after setting is as follows.

BASEDIR=`dirname $0`/..
BASEDIR=`(cd "$BASEDIR"; pwd)`

[ -f "$BASEDIR"/bin/ ] && . "$BASEDIR"/bin/
・ ・ ・ The following is omitted ...

This will load the first created at the beginning of the auto-generated script, so if you set a task to copy under the bin directory after build, it will be in the auto-generated script. You can read the JAVA_HOME settings from.


Recommended Posts

How to set JAVA_HOME with Maven appassembler-maven-plugin
How to set Docker nginx
How to number (number) with html.erb
How to update with activerecord-import
How to set Java constants
How to boot by environment with Spring Boot of Maven
How to set environment variables when using Payjp with Rails
How to set up a proxy with authentication in Feign
How to get started with slim
How to enclose any character with "~"
How to set Spring Boot + PostgreSQL
How to make a Maven project
How to get along with Rails
How to set Lombok in Eclipse
Don't set JAVA_HOME with full path
How to start Camunda with Docker
How to make a jar file with no dependencies in Maven
[Note] How to restart the Windows container set up with docker-compose
How to crop an image with libGDX
How to adjustTextPosition with iOS Keyboard Extension
How to compile Java with VsCode & Ant
[Java] How to compare with equals method
[Android] How to deal with dark themes
How to use BootStrap with Play Framework
[Rails] How to use rails console with docker
[Note] How to get started with Rspec
How to create a Maven repository for 2020
How to do API-based control with cancancan
How to set up and use kapt
[Java] How to set the Date time to 00:00:00
How to achieve file download with Feign
[Java] [Maven3] Summary of how to use Maven3
How to implement TextInputLayout with validation function
How to handle sign-in errors with devise
How to delete data with foreign key
How to test private scope with JUnit
How to monitor nginx with docker-compose with datadog
Needed for iOS 14? How to set NSUserTrackingUsageDescription
How to deal with Precompiling assets failed.
How to achieve file upload with Feign
How to run Blazor (C #) with Docker
How to build Rails 6 environment with Docker
How to apply thymeleaf changes to the browser immediately with #Spring Boot + maven
How to download Oracle JDK 8 rpm with curl
[Java] How to test for null with JUnit
How to mock each case with Mockito 1x
How to mock each case with PowerMock + Mockito1x
How to use ToolBar with super margin Part1 Set characters and change colors
How to test interrupts during Thread.sleep with JUnit
Deploy Java web app to Azure with maven
How to use built-in h2db with spring boot
How to search multiple columns with gem ransack
How to deploy
[Swift] How to link the app with Firebase
How to create multiple pull-down menus with ActiveHash
How to get started with Eclipse Micro Profile
[Java] (for MacOS) How to set the classpath
Maven [ERROR] Bootstrap classpath not set with -source 1.7
How to set up and operate jEnv (Mac)
How to give your image to someone with docker
How to insert all at once with MyBatis