JHipster comes with two Spring "profiles":
dev
prod
Those profiles come in two different configurations:
./mvnw -Pprod package
./gradlew bootRepackage -Pprod
Spring profiles are set by Maven/Gradle, so we have a consistency between the two methods: you will have a "prod" profile on Maven/Gradle and Spring at the same time.
If you run the application without Maven/Gradle, launch the "Application" class (you can probably run it easily from your IDE by right-clicking on it).
If you run the application with Maven, run ./mvnw to use our Maven Wrapper, or mvn to use your own Maven installation.
./mvnw
mvn
If you run the application with Gradle, run ./gradlew to use our Gradle Wrapper, or gradle to use your own Gradle installation.
./gradlew
gradle
You can run JHipster in production directly using Maven or Gradle:
./mvnw -Pprod
mvn -Pprod
./gradlew -Pprod
gradle -Pprod
If you want to package your application, in order to have an executable WAR file, you should also run Maven or Gradle with the "prod" profile:
mvn -Pprod package
./gradlew -Pprod bootRepackage
gradle -Pprod bootRepackage
When you run your production application, don't forget to add the "prod" profile, by adding --spring.profiles.active=prod to your program arguments:
--spring.profiles.active=prod
./java -jar jhipster-0.0.1-SNAPSHOT.war --spring.profiles.active=prod
JHipster comes with two additionnal Spring "profiles" used as switches:
no-swagger
no-liquibase
These can be used along with both dev and prod profiles. Please note that no-swagger doesn't have any effect on prod profile as swagger is disabled by default on that profile.
The are only used at run time:
spring.profiles.active=dev,no-swagger,no-liquibase
./java -jar jhipster-0.0.1-SNAPSHOT.war --spring.profiles.active=prod,no-liquibase
With Maven, you can also use those profiles directly:
./mvnw -Pprod "-Drun.profiles=no-liquibase"
./mvnw "-Drun.profiles=no-liquibase,no-swagger"
With Gradle, you can also use those profiles directly:
./gradlew -Pprod -Pno-liquibase
./gradlew -Pno-liquibase -Pno-swagger