"Make Project" from Build-menu exactly like maven

Answered

I got a huge legacy project to maintain. It uses Maven in a complex build process.

Creating the project from the pom.xml was no problem. (I wonder, though: Is it better to use mvn idea:idea?) It even builds something when I go to Build/Make Project. But there are subtle differences to what "mvn clean install" does. manifest entries missing, variables on config files not replaces, ... It's a really huge project, and I don't know what else might be missing. It's definitely very similar to how it should be already.

 

Is there any way to get Idea to make it EXACTLY like Maven would have?

 

Other than going through the diffs file by file and manually specifying pre-built config files etc., of course. It's a really big project.

8 comments
Comment actions Permalink

Run Maven package task from the Maven Projects tool window instead of Build | Make.

0
Comment actions Permalink

Maven is apparently not configured quite correctly and only works with a CLEAN install, while Idea does a pretty fast build. Also, can I still deploy the artifact and debug on a local application server if the artifact isn't built through Idea?

0
Comment actions Permalink

There is an option to deploy artifact from the external source (the one produced by Maven).

0
Comment actions Permalink

Thanks, all questions answered then! In order to make it faster, I still have to either fix the maven scripts to work without a "clean", or to make a quick ant script to fix the config files that contain variables etc. so Idea can do the job better than maven.

0
Comment actions Permalink

I had a similar question. Is this a bug in IDEA, or is the menu item "Build > Make Project" not supposed to follow Maven? If that menu item doesn't do the same thing as a Maven "compile", I'm not sure what the point of the menu item is. I've got a project that does something in Maven to put a build number (buildnumber-maven-plugin) into a text file resource. Whenever IntelliJ builds it via the "Make Project" menu item, the project crashes on startup because the build number is not in the resource.

 

0
Comment actions Permalink

It's by design. Build | Make uses internal incremental make, not Maven.

0
Comment actions Permalink

I'm looking for a way to specify a "post make" script, but I don't see one. Is there a way? It would be nice to use the incremental compiler, but I need it to do the resource filtering like Maven.

0
Comment actions Permalink

You can to it with Maven, Gradle and Ant: http://i.imgur.com/H9QQO1Z.png.

1

Please sign in to leave a comment.