Issue
I have a Maven Project, Ant Project which are somehow coupled. If I have to make any change in maven project and test it I have to do following steps every time, which is very time consuming.
Steps
And to debug anything I have to create a Remote Debug Configuration which connects to port 8000 and start ant server in debug mode.
All this is new to me as I have only worked on microservices based out of maven when there is a @SpringApplication
class with main
method which I could directly run/debug. In this project, there is no class with main method. It's a legacy spring mvc project.
I seriously want some way to do the same with current project. I tried going though the build.xml but I couldn't get past much of it.
Is there a way possible? Can it run like a normal maven project? Ant is probably building some db and ui parts (not very sure). But I only work on Java side.
Please help. Anything that could get rid of me having to run mvn install
with every small change would also be helpful.
I have tried following post but it did not work for me How to build maven project with ant script?
Solution
I was able to achieve this by Adding ant targets as part of the "Before Launch" inside "Run/Debug Configurations". To reduce the time taken by mvn install
I used the script from this answer here and added that as well, as one of the before launch steps.
It took some time to figure this out but it was a good learning. Now on the click of a button I can perform all the above steps, plus with faster compile time. Infact by enabling Logs, this became super user friendly.
Here is how my config looks like now,
Answered By - coretechie
Answer Checked By - David Goodson (JavaFixing Volunteer)