Refactoring to multiple modules

I have a single maven based war project right now using Spring, JPA, and Jersey. I now need this to be refactored into a War and a Jar. What is the best way to do that? I can see how to add modules but I don't see a way to move classes from one module to another or to push all the WEB-INF and resources into a new module.

Basically I just want to put my REST resources and web.xml into one module that is a WAR (like it is now) and put everything else into another module that the WAR module uses and have that module packaged as a JAR. And I still need this to be a single maven project that I can deploy to heroku from GIT like I am currently doing with the monolithic project.

Is there a simple way to do this? Thanks!



Hi Robert,

As far as I understand, you can just use 'Move' refactoring for that (select target files at the project view and press F6).



I don't see F6 allowing me to move from one module to another and creating the new source path of that module. But maybe I'm missing something?


Please sign in to leave a comment.