maven integration: supported features intellij vs eclipse

Hi,

I'd like to ask this question. Mine colleagues uses eclipse and have, as I observe it, better support of maven. For example, there can be defined variables almost everywhere (web.xml, context.xml) and they're getting substituted on build, MANIFEST.MF gets generated, etc. Configuration files, pom.xml, are defined correctly, but I'm not getting this behavior. This may be caused, that I'm doing something wrong. So that's why I'm asking. Is this features supported or not?

thanks in advance.
martin.

3 comments
Comment actions Permalink

How are you launching the build? If you use anything under the "Build" menu, you are building the IntelliJ IDEA project, not the maven project. IntelliJ IDEA will configure the IntelliJ IDEA project pretty close to the way the maven project is defined. But it does not have identical features for every possible maven plug-in. For example token replacement is not supported. Therefore if you run the IntelliJ IDEA build, you will not get variable substitution or code generation (for your Manifest file). Instead, you need to launch a Maven build from the Maven tool window (or a run/debug configuration) in IntelliJ IDEA. Then you will get all the functionality defined in the maven POM. You can watch this video that I recorded for some coworkers that explains how to run maven build within IntelliJ IDEA.

Let us know if that solves your issue or not. If not, you may need to provide some additional detail.

alfonz19 wrote:

Mine colleagues uses eclipse and have, as I observe it, better support of maven.

I think once you become more familiar with IntelliJ IDEA and its maven integration, you will reverse your opinion on that matter ;)

0
Comment actions Permalink

thanks for really quick answer. And for the video, I'm looking forward to go through it, I hope it'll explain/uncover/unravel my mistakes. I firmly believe that idea is better than eclipse(*) and problems I'm experiencing are solely caused that I'm just doing something wrong. So if there is some place where there are screencast/articles/whatever describing concepts how to do certain things and how they should not be done, I'll be glad to read/watch them (problem with documentation is, that it's sometimes too detailed, that the whole picture cannot be seen, and can be used just to find particular very specific aspect).

And one more question about maven and running its builds from idea. Maybe I'm wrong, but isn't that a 'complete' build always instead of incremental? How to intermix incremental builds with maven ones? (I havent seen the video yet, so if it's covered in it, do not answer this question).

martin.


(*) Few years back had arisen my hatred to eclipse, during its repetitive internal error during base installation...

0
Comment actions Permalink

alfonz19 wrote:

So if there is some place where there are screencast/articles/whatever describing concepts how to do certain things and how they should not be done, I'll be glad to read/watch them (problem with documentation is, that it's sometimes too detailed, that the whole picture cannot be seen, and can be used just to find particular very specific aspect).

Some resources for you:

  • The IntelliJ Wiki which includes a Maven FAQ page
  • The IntelliJ IDEA channel at the JetBrains TV site. There is a Maven Support video. Also remember that the other IDE's -- such as PhpStorm, PyCharm, RubyMine and WebStorm for example -- are subsets of IntelliJ IDEA. So in most cases, a feature in one of those is available in IntelliJ IDEA
  • The IntelliJ IDEA blog, specifically entries tagged with maven


alfonz19 wrote:

And one more question about maven and running its builds from idea. Maybe I'm wrong, but isn't that a 'complete' build always instead of incremental? How to intermix incremental builds with maven ones? (I havent seen the video yet, so if it's covered in it, do not answer this question).

When you build from maven, it will be a complete build. (In a multi-module build you can build just one module, but that module is completely built). There is a Maven Incremental Build plug-in available to allow maven to run incremental builds. I've never used it. I tend to favor breaking things out into small modules. And since small modules build so quickly, I do not see a benefit in incremental builds. Another option that can act like a pseudo incremental build is to just run the compile goal rather then the test or package goal. In most projects, the compile is very quick. It's running the unit test that can take a bit longer.

You can also build the IntelliJ IDEA project. IDEA is (by default) configured to run an incremental build. My normal workflow is this: as I code, I write unit tests. I run the tests within IDEA, which automatically triggers an incremental build. I continue to do this, Then periodically I run "clean package" or a "clean install" in maven to ensure everything is working well together. The place where this strategy will not work is when the maven build manipulates (variable substitution for example) or generates the source code. In those cases, I'll just stick to running compiles and test within maven, If the build is a bit too long, I'll create a run configuration that only runs the test or tests for the code I am actively working on, That allows the build to run faster.

Lastly, keep in mind tha IntelliJ IDEA will show any potential errors even without running an incremental build. This is further enhanced, as discussed in this blog entry, in the upcoming IntelliJ IDEA version 12 for which a preview is available.

0

Please sign in to leave a comment.