Maven integration: default output directories
There's a nagging screen when importing a maven project asking for a compiler output path. This is counterintuitive, as:
1. m2 inherently has compiler output paths configured already in poms
2. This setting is set globally for all modules, which forward all Make output to this folder (individual m2 goals on projects use the m2 target output directories)
Now, I understand there are 2 styles for co-hosting IDEA-compiled and m2 compiled classes:
1. One I prefer - IDEA compiles to the same folders as m2, configured individually per-project (target by default, relative to module root)
2. Current one, whereas IDEA output is hosted separately.
The 2nd scenario is currently covered, though not the first. There should be a default setting to follow the m2 conventions, and use pom information, per-module. And have the option to override and use the single dedicated output path, as now.
Opinions?
Please sign in to leave a comment.
I agree and also for the following reason: I guess most of us have been using the maven-idea-plugin to create projects files from IDEA projects. So it is good to follow that standard.
Also, isn't what IDEA does now simply going to break maven plugins that depend on the module/target/classes directory being there? I think it is extemely important to follow maven conventions (that is what maven is all about) so that we are also still able to use maven from the command line in combination with using it from IDEA.
S.
This is very easy to fix, but there is important detail:
IDEA make does not reuse class files created by external tools (ant, maven,
javac from command line). This means that if you point IDEA's output to the
same directory as Maven's, and build your project with Maven, the next IDEA
make will recompile everything.
I am not sure how it would work the other way around, but I will try today.
Anyway, what you are asking for is what old plugins did, so I will provide
such option.
Vladislav Kaznacheev
Project Manager, IntelliJ IDEA
http://www.jetbrains.com
"Develop with Pleasure!"
>> There's a nagging screen when importing a maven project asking for a
>> compiler output path. This is counterintuitive, as:
>>
>> 1. m2 inherently has compiler output paths configured
>> already in poms
>> 2. This setting is set globally for all modules,
>> which forward all Make output to this folder
>> (individual m2 goals on projects use the m2 target
>> output directories)
>> Now, I understand there are 2 styles for co-hosting IDEA-compiled and
>> m2 compiled classes:
>>
>> 1. One I prefer - IDEA compiles to the same folders as m2, configured
>> individually per-project (target by default, relative to module root)
>>
Vlad, I'm not sure about that. What IDEA did in those cases was incremental compilation. E.g.:
1. Compile a module with mvn externally
2. Run IDEA, classes were picked up properly
or
1. Compile a module with mvn externally
2. Modify a source file in IDEA
3. Hit Make - only the modified source recompiled.
My impression was that 'Synchronizing output folders' step during make handled those.
And, if it weren't the case, the above is the way it must be anyway.
Regards,
Andrew
Regarding the maven integration - will IDEA bundle Maven 2.0.6 similar
to how it currently bundles Ant?
And if so - will the bundled Ant also include the Maven Ant Tasks jar in
its lib?
This would make for a great out of the box maven experience...
Vladislav Kaznacheev wrote on 29/05/07 01:32:
Hello Mark,
We will bundle not Maven 2.0.6, but Maven Embedder which is basically the
engine behind the Maven. Anyway, there will be no need to install Maven manually.
Best regards,
Vladislav Kaznacheev
Project Manager, IntelliJ IDEA
http://www.jetbrains.com
"Develop with Pleasure!"
>> This is very easy to fix, but there is important detail:
>>
I had to choose the 'Use embedded maven' option first before the plugin would work. Maybe that is a good default then? :)
S.
I had M2_HOME and MAVEN_OPTS configured in the environment. In IDEA chose 'Use external Maven' but left the path empty.
Everything was picked up properly, even the MAVEN_OPTS command switches. So, my suggestion here would be to update the UI to hint the external can use one's env defaults, and make M2_HOME field entry optional (and state its optional).
Already done
Vladislav Kaznacheev
Project Manager, IntelliJ IDEA
http://www.jetbrains.com
"Develop with Pleasure!"
>> Hello Mark,
>>
>> We will bundle not Maven 2.0.6, but Maven Embedder
>> which is basically the
>> engine behind the Maven. Anyway, there will be no
>> need to install Maven manually.