(cd docker; docker-compose up -d)
mvn -N io.takari:maven:wrapper
./mvnw clean package site
./mvnw clean package
./mvnw -Pfrontend -DskipTests
- https://github.com/Swagger2Markup/spring-swagger2markup-demo
- http://docs.spring.io/spring-restdocs/docs/1.2.1.RELEASE/reference/html5/
- https://springfox.github.io/springfox/docs/current/
./mvnw -pl frontend frontend:install-node-and-npm
./mvnw -pl frontend -P frontend generate-resources
For get cli analogs of any <configuration>
property see its Expression (Ctrl + Q in IntelliJ IDEA)
and pass it with -D
:
./mvnw -Dfrontend.npm.arguments=version -pl frontend frontend:npm
./mvnw -Dfrontend.npm.arguments='run dev' -pl frontend frontend:npm
docker-compose -f docker-compose.yml -f docker-compose.demo.yml up -d
- "./mvnw -Dkarma.browsers=Firefox -Dcustom.selenium.browser=FIREFOX -P frontend clean package"
- "./mvnw -Dkarma.browsers=Chrome -Dcustom.selenium.browser=CHROME -P frontend clean package"
You should clear jest cache after change .babelrc
See here.
To see where is jest cache you can
jest --showConfig | grep -i cache
mvn help:describe -Dcmd=compile
./mvnw fr.jcgay.maven.plugins:buildplan-maven-plugin:list-phase
docker exec $(docker inspect --format "{{.Status.ContainerStatus.ContainerID}}" $(docker service ps BLOGSTACK_postgresql --filter desired-state=running -q)) pg_dump -U blog -b --create --column-inserts --serializable-deferrable > /tmp/dump.sql```
cat <(echo -n "drop database blog;") ~/blog/$(ls ~/blog | grep backup- | sort | tail -n 1)/blog.sql | docker exec -i postgresql-blog-dev psql -U postgres
./mvnw -DskipTests clean install
https://dou.ua/lenta/articles/problems-with-java-9/ https://stackoverflow.com/questions/43258796/hibernate-support-for-java-9
Add in docker yml
command: ["--spring.flyway.baselineOnMigrate=true"]
command: ["--spring.flyway.baselineOnMigrate=true", "--spring.flyway.baselineVersion=32767"]
if demo profile enabled
There is highly recommends to shut down your application on 8080, although tests uses 9080, some of them can fails, with websocket for example.
./mvnw -P frontend -P docker clean package
As you can see, there is switches via maven profiles.
This will run tests on Chrome.
See .travis.yml
for Firefox and Chrome test examples
./mvnw clean package
cd docker
docker-compose -f docker-compose.yml -f docker-compose.nginx.yml -f docker-compose.dev.yml up -d --build
# By default
java -jar frontend/target/frontend-1.0.3-SNAPSHOT-exec.jar
# .. or with pre-generated content
java -jar frontend/target/frontend-1.0.3-SNAPSHOT-exec.jar --spring.profiles.active=demo
Test user credentials can be found in backend/src/main/resources/db/demo/V32000__demo.sql
:4
./mvnw -DnewVersion=1.0.0 versions:set versions:commit
./mvnw -DlogOutput=false -DprocessDependencyManagement=false versions:display-dependency-updates | less
./mvnw -DlogOutput=false versions:display-property-updates | less
./mvnw -DlogOutput=false versions:display-plugin-updates | less
shedlock
hibernate-types-52
selenide
webdrivermanager
./mvnw clean spring-boot:run
cd frontend
npm run dev
cd frontend
npm run test
# where is it
npm run test -- --showConfig | grep cache
rm -rf /var/tmp/jest_rs
https://www.npmjs.com/package/npm-check-updates
ncu -u
rm package-lock.json
npm install
# globally seems not working
cd frontend
npm i ndb
node_modules/ndb/ndb.js .
Q: I suddenly get http 403 error in JUnit mockMvc tests.
A: Add .with(csrf())
to MockMvcRequestBuilder chain
- Add profile
jacoco
./mvnw -Pjacoco clean package
- See coverage HTML report in
./jacoco/target/site/jacoco-aggregate/index.html
directory.
curl -X GET -H "Content-Type:application/json" -d '{
"query": {
"prefix": {
"text": "почт"
}
}
}' 'http://127.0.0.1:19200/blog/_search' | jq
curl -X GET -H "Content-Type:application/json" -d '{
"query": {
"bool":{
"should": [
{"match_phrase_prefix": { "text": "почт" }},
{"match_phrase_prefix": { "title": "почт" }}
]
}
},
"_source": ["_"],
"highlight" : {
"fields" : {
"text" : { "fragment_size" : 150, "pre_tags" : ["<em>"], "post_tags" : ["</em>"], "number_of_fragments" : 5 },
"title" : { "fragment_size" : 150, "pre_tags" : ["<em>"], "post_tags" : ["</em>"], "number_of_fragments" : 5 }
}
}
}' 'http://127.0.0.1:19200/blog/_search' | jq
curl -X GET -H "Content-Type:application/json" -d '{
"query": {
"bool":{
"should": [
{"match_phrase_prefix": { "text": "рыбами" }},
{"match_phrase_prefix": { "title": "рыбами" }}
]
}
},
"highlight" : {
"fields" : {
"text" : { "fragment_size" : 150, "pre_tags" : ["<em>"], "post_tags" : ["</em>"], "number_of_fragments" : 5 },
"title" : { "fragment_size" : 150, "pre_tags" : ["<em>"], "post_tags" : ["</em>"], "number_of_fragments" : 1 }
}
},
"sort" : [
{"id" : {"order" : "desc"}}
]
}' 'http://127.0.0.1:19200/post/_search' | jq
./mvnw -pl common-test clean install