Idea + gradle + spring boot

Answered

Good day ! I have Spring boot application and some problems with compile + run it through idea.
Default work flow
1) write code
2) push build project button
3) push debug button
- all work well
1) write code
2) write gradle clean build in console
3) write gradle run
- all work right

1) write code
2) execute gradle task - clean build
3) can't start application

I understand that idea spring starter want to load *.class file from out/production/classes/
But gradle task use another class hierarhy 
ls build/
classes distributions libs log production reports resources scripts test-results tmp

I cange some time working directory in run configuration but it isn't work.


0
3 comments

but why it is Idea don't use ''working directory" like directory with classes

0
This elegant script help me to fix idea behavior
  • rm -rf out/
  • mkdir -p out/production/classes
  • cp -r build/classes/scala/main/* out/production/classes/
  • mkdir -p out/production/resources
  • cp -r build/resources/main/* out/production/resources/

    other reciept doesn't work for scala project
0

Please sign in to leave a comment.