Skip to content

Commit

Permalink
synchronize from latest generator, with Travis update
Browse files Browse the repository at this point in the history
  • Loading branch information
jdubois committed Oct 6, 2016
1 parent df5b9b5 commit a47315f
Show file tree
Hide file tree
Showing 24 changed files with 216 additions and 114 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Expand Up @@ -55,6 +55,11 @@ local.properties
*.ids
*.orig

######################
# Visual Studio Code
######################
.vscode/**

######################
# Maven
######################
Expand Down
8 changes: 7 additions & 1 deletion .travis.yml
@@ -1,4 +1,10 @@
os:
- linux
services:
- docker
language: java
node_js:
- "4.5.0"
jdk:
- oraclejdk8
sudo: false
Expand All @@ -8,7 +14,7 @@ cache:
- node_modules
- $HOME/.m2
env:
- NODE_VERSION=4.4.7
- NODE_VERSION=4.5.0
before_install:
- nvm install $NODE_VERSION
- npm install -g npm
Expand Down
3 changes: 2 additions & 1 deletion .yo-rc.json
Expand Up @@ -28,6 +28,7 @@
"enableSocialSignIn": false,
"useSass": false,
"jhiPrefix": "jhi",
"messageBroker": false
"messageBroker": false,
"serviceDiscoveryType": false
}
}
86 changes: 52 additions & 34 deletions README.md
@@ -1,11 +1,10 @@
# jhipsterSampleApplication

This application was generated using JHipster, you can find documentation and help at [https://jhipster.github.io](https://jhipster.github.io).
This application was generated using JHipster 3.8.0, you can find documentation and help at [https://jhipster.github.io/documentation-archive/v3.8.0](https://jhipster.github.io/documentation-archive/v3.8.0).

## Development

Before you can build this project, you must install and configure the following dependencies on your machine:

1. [Node.js][]: We use Node to run a development web server and build the project.
Depending on your system, you can install Node either from source or as a pre-packaged bundle.

Expand All @@ -16,7 +15,7 @@ After installing Node, you should be able to run the following command to instal

We use [Gulp][] as our build system. Install the Gulp command-line tool globally with:

npm install -g gulp
npm install -g gulp-cli

Run the following commands in two separate terminals to create a blissful development experience where your browser
auto-refreshes when files change on your hard drive.
Expand All @@ -28,61 +27,80 @@ Bower is used to manage CSS and JavaScript dependencies used in this application
specifying a newer version in `bower.json`. You can also run `bower update` and `bower install` to manage dependencies.
Add the `-h` flag on any command to see how you can use it. For example, `bower update -h`.

For further instructions on how to develop with JHipster, have a look at [Using JHipster in development][].

## Building for production

To optimize the jhipsterSampleApplication client for production, run:
To optimize the jhipsterSampleApplication application for production, run:

./mvnw -Pprod clean package

This will concatenate and minify CSS and JavaScript files. It will also modify `index.html` so it references
these new files.

This will concatenate and minify the client CSS and JavaScript files. It will also modify `index.html` so it references these new files.
To ensure everything worked, run:

java -jar target/*.war

Then navigate to [http://localhost:8080](http://localhost:8080) in your browser.

Refer to [Using JHipster in production][] for more details.

## Testing

To launch your application's tests, run:

./mvnw clean test

### Client tests

Unit tests are run by [Karma][] and written with [Jasmine][]. They're located in `src/test/javascript/` and can be run with:

gulp test

UI end-to-end tests are powered by [Protractor][], which is built on top of WebDriverJS. They're located in `src/test/javascript/e2e`
and can be run by starting Spring Boot in one terminal (`./mvnw spring-boot:run`) and running the tests (`gulp itest`) in a second one.
### Other tests

Performance tests are run by [Gatling]() and written in Scala. They're located in `src/test/gatling` and can be run with:
Performance tests are run by [Gatling][] and written in Scala. They're located in `src/test/gatling` and can be run with:

./mvnw gatling:execute


## Continuous Integration

To setup this project in Jenkins, use the following configuration:

* Project name: `jhipsterSampleApplication`
* Source Code Management
* Git Repository: `git@github.com:xxxx/jhipsterSampleApplication.git`
* Branches to build: `*/master`
* Additional Behaviours: `Wipe out repository & force clone`
* Build Triggers
* Poll SCM / Schedule: `H/5 * * * *`
* Build
* Invoke Maven / Tasks: `-Pprod clean package`
* Execute Shell / Command:
````
./mvnw spring-boot:run &
bootPid=$!
sleep 30s
gulp itest
kill $bootPid
````
* Post-build Actions
* Publish JUnit test result report / Test Report XMLs: `build/test-results/*.xml,build/reports/e2e/*.xml`

[JHipster]: https://jhipster.github.io/
For more information, refer to the [Running tests page][].

## Using Docker to simplify development (optional)

You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the `src/main/docker` folder to launch required third party services.
For example, to start a mysql database in a docker container, run:

docker-compose -f src/main/docker/mysql.yml up -d

To stop it and remove the container, run:

docker-compose -f src/main/docker/mysql.yml down

You can also fully dockerize your application and all the services that it depends on.
To achieve this, first build a docker image of your app by running:

./mvnw package -Pprod docker:build

Then run:

docker-compose -f src/main/docker/app.yml up -d

For more information refer to [Using Docker and Docker-Compose][], this page also contains information on the docker-compose sub-generator (`yo jhipster:docker-compose`), which is able to generate docker configurations for one or several JHipster applications.

## Continuous Integration (optional)

To set up a CI environment, consult the [Setting up Continuous Integration][] page.

[JHipster Homepage and latest documentation]: https://jhipster.github.io
[JHipster 3.8.0 archive]: https://jhipster.github.io/documentation-archive/v3.8.0

[Using JHipster in development]: https://jhipster.github.io/documentation-archive/v3.8.0/development/
[Using Docker and Docker-Compose]: https://jhipster.github.io/documentation-archive/v3.8.0/docker-compose
[Using JHipster in production]: https://jhipster.github.io/documentation-archive/v3.8.0/production/
[Running tests page]: https://jhipster.github.io/documentation-archive/v3.8.0/running-tests/
[Setting up Continuous Integration]: https://jhipster.github.io/documentation-archive/v3.8.0/setting-up-ci/

[Gatling]: http://gatling.io/
[Node.js]: https://nodejs.org/
[Bower]: http://bower.io/
Expand Down
5 changes: 4 additions & 1 deletion gulp/serve.js
Expand Up @@ -15,7 +15,10 @@ module.exports = function () {
// redirect. This is required for some endpoints for proxy-middleware
// to correctly handle them.
var proxyRoutes = [
'/'
'/api',
'/management',
'/swagger-resources',
'/h2-console'
];

var requireTrailingSlash = proxyRoutes.filter(function (r) {
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
@@ -1,4 +1,4 @@
// Generated on 2016-09-22 using generator-jhipster 3.8.0
// Generated on 2016-10-06 using generator-jhipster 3.8.0
'use strict';

var gulp = require('gulp'),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -9,7 +9,7 @@
],
"devDependencies": {
"bower": "1.7.9",
"browser-sync": "2.15.0",
"browser-sync": "2.17.0",
"del": "2.2.2",
"eslint-config-angular": "0.5.0",
"eslint-plugin-angular": "1.3.1",
Expand Down
111 changes: 98 additions & 13 deletions pom.xml
Expand Up @@ -20,7 +20,7 @@
</prerequisites>

<properties>
<hikaricp.version>2.4.6</hikaricp.version>
<argLine>-Djava.security.egd=file:/dev/./urandom -Xmx256m</argLine>
<assertj-core.version>3.5.2</assertj-core.version>
<awaitility.version>1.7.0</awaitility.version>
<commons-io.version>2.5</commons-io.version>
Expand All @@ -29,6 +29,7 @@
<gatling.version>2.1.7</gatling.version>
<gatling-maven-plugin.version>2.1.7</gatling-maven-plugin.version>
<hibernate.version>4.3.11.Final</hibernate.version>
<hikaricp.version>2.4.6</hikaricp.version>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
Expand All @@ -49,7 +50,7 @@
<springfox.version>2.5.0</springfox.version>
<!-- Sonar properties -->
<project.testresult.directory>${project.build.directory}/test-results</project.testresult.directory>
<sonar-maven-plugin.version>3.0.2</sonar-maven-plugin.version>
<sonar-maven-plugin.version>3.2</sonar-maven-plugin.version>
<jacoco-maven-plugin.version>0.7.7.201606060606</jacoco-maven-plugin.version>
<sonar.exclusions>src/main/webapp/content/**/*.*, src/main/webapp/bower_components/**/*.*, target/www/**/*.*</sonar.exclusions>
<sonar.java.codeCoveragePlugin>jacoco</sonar.java.codeCoveragePlugin>
Expand Down Expand Up @@ -196,13 +197,6 @@
</exclusion>
</exclusions>
</dependency>
<!-- The HikariCP Java Agent is disabled by default, as it is experimental
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP-agent</artifactId>
<version>${HikariCP.version}</version>
</dependency>
-->

<dependency>
<groupId>commons-io</groupId>
Expand Down Expand Up @@ -499,7 +493,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Djava.security.egd=file:/dev/./urandom -Xmx256m ${surefireArgLine}</argLine>
<!-- Force alphabetical order to have a reproducible build -->
<runOrder>alphabetical</runOrder>
</configuration>
Expand All @@ -517,8 +510,6 @@
<configuration>
<!-- Sets the path to the file which contains the execution data. -->
<destFile>${project.testresult.directory}/coverage/jacoco/jacoco.exec</destFile>
<!-- Sets the name of the property containing the settings for JaCoCo runtime agent. -->
<propertyName>surefireArgLine</propertyName>
</configuration>
</execution>
<!-- Ensures that the code coverage report for unit tests is created after unit tests have been run -->
Expand Down Expand Up @@ -695,7 +686,6 @@
</plugins>
</pluginManagement>
</build>

<profiles>
<profile>
<id>no-liquibase</id>
Expand Down Expand Up @@ -857,5 +847,100 @@
<spring.profiles.active>prod${profile.swagger}${profile.no-liquibase}</spring.profiles.active>
</properties>
</profile>
<profile>
<!--
Profile for doing "continuous compilation" with the Scala Maven plugin.
It allows automatic compilation of Java classes as soon as they are saved.
To use it, run in 3 terminals:
- './mvnw -Pcc scala:cc' for continous compilation of your classes
- './mvnw -Pcc' for hot reload of Spring boot
- 'gulp' for hot reload of the HTML/JavaScript assets
Everything should hot reload automatically!
-->
<id>cc</id>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warSourceDirectory>src/main/webapp/</warSourceDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
<fork>true</fork>
<addResources>true</addResources>
<!--
Enable the line below to have remote debugging of your application on port 5005
<jvmArguments>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</jvmArguments>
-->
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-compile</id>
<phase>none</phase>
</execution>
<execution>
<id>default-testCompile</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>add-source</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<recompileMode>incremental</recompileMode>
<verbose>true</verbose>
<scalaVersion>2.11.7</scalaVersion>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<!-- log configuration -->
<logback.loglevel>DEBUG</logback.loglevel>
<!-- default Spring profiles -->
<spring.profiles.active>dev,swagger</spring.profiles.active>
</properties>
</profile>
</profiles>
</project>
2 changes: 1 addition & 1 deletion src/main/docker/sonar.yml
Expand Up @@ -2,7 +2,7 @@ version: '2'
services:
jhipstersampleapplication-sonar:
container_name: jhipstersampleapplication-sonar
image: sonarqube:5.6.1-alpine
image: sonarqube:5.6.2-alpine
ports:
- 9000:9000
- 9092:9092
Expand Up @@ -14,6 +14,9 @@ public final class DefaultProfileUtil {

private static final String SPRING_PROFILE_DEFAULT = "spring.profiles.default";

private DefaultProfileUtil(){
}

/**
* Set a default to use when no profile is configured.
*
Expand Down

0 comments on commit a47315f

Please sign in to comment.