As mentioned here as well as here it should be possible - and a must-have for the docker-container - to be able to build a WAR-file of the whole application with ./gradlew -Pprod bootWar or make the application ready for a deployment via docker-container with ./gradlew bootWar -Pprod buildDocker.
But Intellij IDEA tells me, that there is no task bootWar. And ./gradlew -Pprod bootRundoesn't generate a *.war-file in build/libs/.
I also tried publishing directly to heroku, triggered by pushes to my github-repository controlled by a local jenkins2 docker-container. Maybe even the 404-Site after successful builds at heroku comes from this. The manual way documented in the jhipster.tech-documentation with ./gradlew -Pprod bootWar -x test and heroku deploy:jar --jar build/libs/*war can't work without the *.war.
So how can I export my monolithic jhipster-application into a *.war-file?
AFAIK you can generate a war with gradle by typing the following command
./gradlew -P prod build and/or ./gradlew -P prod build bootRepackage
Related
Basic Spring Boot app with Gradle.
If I build locally with Gradle using
./gradlew clean build
my jar is in
build/
But when using GitLab's pipelines with the following config
gradle-build:
image: gradle:alpine
stage: build
script:
- ./gradlew clean build
artifacts:
paths:
- build/libs/*.jar
The jar is in
build/libs
The "artifacts -> paths" config is just to share the jar with the next step of the pipeline, which is building the docker container.
So why the difference between the 2 ?
I like to have consistency and have the same thing locally as on the build server.
Thanks.
I am trying to automate some tasks. Currently my jenkins job performs heroku buildpacks and creates slug to be deployed.
But heroku/gradle buildpack, won't run unit tests & and other tests which can be configured locally with the help of libraries and docker.
I want to either create my custom buildpack which would run something like:
./gradlew taskName(~defined in build.gradle)
Or is there a way I can customize this instead of running | ./gradlew build -x check - which I believe is default in heroku/gradle buildpack and can be replaced by
./gradlew build -x check && ./gradlew taskName
Is this achievable? Any help is appreciated.
Thank you!
I am reading Full Stack Development with JHipster book.
I created a Microservice gateway with 'gateway' app name.
By following the book when I run
./gradlew bootRepackage -Pprod buildDocker
in the terminal, it says
Task 'bootRepackage' not found in root project 'gateway'
and then stop running.
My Jhipster version is 5.0.0
In JHipster v5.0.0+, the goal bootRepackage doesn't exist. It has changed to bootWar, so you need to use:
./gradlew bootWar -Pprod buildDocker
I have similar issue for Spring Boot 2.X. And solved it by changing to bootJar.
gradlew clean && gradlew bootJar
I have setup a multi module spring boot application including Google appengine integration. Locally everything works fine.
If I do a clean checkout of my GIT repo and after that execute
mvn clean install
mvn appengine:deploy
The app gets properly deployed to Google appengine
If I try to do the same on gitlab using the following deploy pipeline
deploy-prod:
stage: deploy
image: $CI_REGISTRY_IMAGE/build
when: manual
environment: prod
script:
- 'mvn clean install'
- 'mvn appengine:deploy'
I get an error saying:
Failed to execute goal on project XXX: Could not resolve dependencies
for project YYY:XXX:war:0.0.1-SNAPSHOT: Could not find artifact
YYY:XXX:jar:0.0.1-SNAPSHOT
Do you have any idea what is wrong/different here? Never had such problems on Gitlab? And I have no idea what is different to the case when I do a clean checkout locally and execute the same commands there?
Thanks for your help.
I assume, you are checking it at your local machine. But have you checked it with $CI_REGISTRY_IMAGE/build manually? I think there is an issue with the docker image itself.
I have a project which is based on gradle .I have to run the command which is equivalent for mvn clean verify .As I am new to both gradle and maven ,and have been exposed to only 3 command of both .I want to run a gradle equivalent for mvn clean verify .I searched on websites but still have not got the answer .Can some please help me to know what will be the gradle equivalent for "mvn clean verify"
gradle clean verify
or if you are using gradle wrapper:
./gradlew clean verify