-
Notifications
You must be signed in to change notification settings - Fork 9
Dev Setup
Configuring a development environment
- JSE 14+ or Open JDK14
- Java IDE
- Either IntelliJ IDEA 2020.1+
- Either Eclipse 2020‑03+ (java package) + Lombok + Java14 JDT patch from the marketplace for version before 2020‑06.
- (recommended) Docker
- (recommended) Maven 3.6.3+
- A MySQL (or another compatible) database
For the below samples, a MySQL server for ligoj-api
container is needed.
Note: At the first start, schema is updated/created and the initial data is inserted into the database.
mysql --user=root
CREATE DATABASE `ligoj` DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_bin;
CREATE USER 'ligoj'@'localhost' IDENTIFIED BY 'ligoj';
GRANT ALL ON `ligoj`.* TO 'ligoj'@'localhost';
FLUSH PRIVILEGES;
quit
docker run --name ligoj-db -d -p 3306:3306 -e MYSQL_RANDOM_ROOT_PASSWORD=yes -e MYSQL_DATABASE=ligoj -e MYSQL_USER=ligoj -e MYSQL_PASSWORD=ligoj -d mysql:5.7
Docker build (ARG) variables:
NEXUS_URL : Repository base host used to download the WAR files
VERSION : Ligoj version, used to build the WAR_URL
WAR_URL : Full WAR URL, built from NEXUS_URL and VERSION
git clone https://github.com/ligoj/ligoj
mvn spring-boot:run -f app-api/pom.xml&
mvn spring-boot:run -f app-ui/pom.xml&
From your IDE, without Maven runner (but Maven classpath contribution), create and execute 2 run configurations with the following main classes :
org.ligoj.boot.api.Application
org.ligoj.boot.web.Application
Notes these launchers (*.launch) are already configured for Eclipse. See Wiki page for more information.
When the WAR is built you can enable minified CSS/JS with the maven profile 'minify'. This requires 'clean-css-cli' NPM module.
npm install clean-css-cli -g
mvn clean package -Pminifiy -DskipTests=true
Nexus OSS
mvn clean deploy -Dgpg.skip=false -Psources,javadoc,minify -DskipTests=true
Bintray
mvn deploy -Dgpg.skip=false -Psources,javadoc,bintray,minify -DskipTests=true
For Eclipse compiler, enable 'Store information about method parameters (usable with reflection)' in general preferences/Java/Compiler