23 Replies Last post: Jan 31, 2012 4:50 PM by Bernard AMADE  
Robert Nicholson Newbie 64 posts since
Apr 12, 2003
Currently Being Moderated

Jan 11, 2010 9:36 PM

Maven support?

So, right now you can add a POM and it builds the project dependencies but I have a couple of questions.

 

1. how does it handle maven exclusions?

 

2. does it make any effort to switch "export" off?

 

What are the limitations and how similar can I expect it to match mvn dependency:tree in terms of the versions

it includes in the classpath?

constv  Novice 149 posts since
Nov 8, 2002
Currently Being Moderated
Jan 12, 2010 5:28 PM in response to: Robert Nicholson
Re: Maven support?

Robert,

I am not sure I understand the problem you are describing. I have been using IDEA's Maven support for years now, and, while I remember some things occasionally not working properly in the past, it seems very solid now. I always have IDEA configured to use the external Maven (not bundled) to run the targets. I have never had a problem with IDEA creating a multi-module project from POMs, managing dependencies and exclusions. Could it be that the problem you are facing is within your POMs? How complex/convoluted are they?

constv  Novice 149 posts since
Nov 8, 2002
Currently Being Moderated
Jan 13, 2010 1:18 AM in response to: Robert Nicholson
Re: Maven support?

Ah, I see what you are saying now... I never use the IDEA compilation when I use Maven. I always use my external Maven's compile and install, etc. - launching it via IntelliJ's Maven pane.  One of the many reasons I use Maven is that I want all my projects and builds to be IDE-agnostic. Even although I only use IDEA, I need to make sure that everything will work consistently for Eclipse users. (And I just go crazy when I see Eclipse users defining Eclipse-specific plugins in their POMs, etc., so I am obsessed about maintaining the purity of the projects.)  That also ensures that my builds are always identical to the centralized nightly/continuous builds on the server. So, I have to admit, I can't really be sure that IntelliJ is not doing something out of whack with your jars when it builds on its own. For all it's worth, in my experience, IDEA generates projects and modules quite nicely from external POMs. perhaps there's something in the POMs that "confuses" IDEA? How complex are they?

constv  Novice 149 posts since
Nov 8, 2002
Currently Being Moderated
Jan 13, 2010 4:57 AM in response to: Robert Nicholson
Re: Maven support?

Are you sure that is the correct Maven location? Are you using a mac? On Leopard, you should have the latest Maven (v2.2 as of now) in "/usr/share/maven".

Gary Halcon Newbie 34 posts since
Jan 20, 2011
Currently Being Moderated
Jan 20, 2011 11:26 PM in response to: Robert Nicholson
Re: Maven support?

Any updates to this issue?

 

I know its been a year since the last post but I am running into similar problems.

Alexander Ashitkin Novice 223 posts since
Sep 25, 2009
Currently Being Moderated
Jan 21, 2011 6:52 AM in response to: Robert Nicholson
Re: Maven support?

for me it's a bad design to play with classpath entries order. if you need it, define custom classloader and make your cool stuff and choose reqiuired jar once requested. Your case is a very specific, although idea  should allow this if maven does.

Bernard AMADE Newbie 66 posts since
Dec 8, 2011
Currently Being Moderated
Jan 18, 2012 3:19 PM in response to: Robert Nicholson
Re: Maven support?

resurrecting this thread

I have a big multi-module project using maven

on this project there are developpers in different part of the world (and most do not use Intellj )

now I have constant problems: apparently IntelliJ re-builds its internal descriptions from the pom.xml files

each time I start IntelliJ I have new problems to face because dependencies between modules fail

so sometime I have the source code that is ok by referencing the other module code, but the binary is not the correct one (funny for debuging)

or lot of other surprises ... so I am constantly tweaking the project configuration to deal with modules dependencies

I just try to play with the GUI ("project structure") to deal with module dependencies (direct dependencies or maven ones) and by magic it may work (though I have not understood the logic)

-btw I don't understand why it is impossible to import some maven dependencies (if I have a jar version 1.1 GUI just shows version 1.0 and no way to have the one I want!)-

this said I am now stuck by a funny dependency problem: the source code says it's ok but compiling yields :

"The type XXXX  cannot be resolved. It is indirectly referenced from required .class files"

if compiled/run directly by maven everything is ok ....

I suspect this: the maven descriptions are so complex across so many modules that there may be some maven dependency anomalies

curiously maven is happy with that and runs, but IntelliJ being too clever just gets lost....

Anton Makeev JetBrains 1,294 posts since
Dec 19, 2006
Currently Being Moderated
Jan 18, 2012 4:32 PM in response to: Bernard AMADE
Re: Maven support?

Guys,

please provide detailed information on a specific problem so we could reproduce it.

The best way to get it fixed is to make and send us a simple project that we can open and see the problem.

 

If you have such a specific problem, please file bug request in ht ebug tracker youtrack.jetbrains.net/issues.

 

 

Thanks,

Anton Makeev

Bernard AMADE Newbie 66 posts since
Dec 8, 2011
Currently Being Moderated
Jan 18, 2012 4:50 PM in response to: Anton Makeev
Re: Maven support?

you are absolutely right

now how to be specific when you do not know how to reproduce the problem at a sizeable level?

there are two modules involved for sure in this specific problem but the path of maven dependencies is staggeringly big!

(and it is the whole project that suffers of endemic dependencies plagues)

so my questions were more:

     - are other people in trouble with very big maven projects?

    - what does : "The type XXXX cannot be resolved. It is indirectly referenced from required .class files" may mean ?

what I suspect is not a bug from IntelliJ but an incompatibility when maven projects have dependencies anomalies .... which I am unable fo find

other IDE such as Netbeans that delegates directly to maven have no such problem (though they face other anomalies )

now if you want a copy of the whole project that can be done ....

thanks for replying

Bernard AMADE Newbie 66 posts since
Dec 8, 2011
Currently Being Moderated
Jan 18, 2012 5:19 PM in response to: Bernard AMADE
Re: Maven support?

out of sheer despair I tried to compile the module under netbeans

it compiles !

the class files are ok

so now back to IntelliJ ... running a code in the same module: it tries to recompile those files !!

why does IntelliJ tries to recompile codes that are up to date? (and BTW that are in no way related to the code to run: they just happen to be in the same module)

as an old user of tools such as "make" I am a bit baffled by that! Is there a way to survive in a module with some unrelated codes that do not compile? (or is it a "all or nothing" strategy?)

Anton Makeev JetBrains 1,294 posts since
Dec 19, 2006
Currently Being Moderated
Jan 18, 2012 7:58 PM in response to: Bernard AMADE
Re: Maven support?

Bernand,

 

I still cannot understand the problem you are having.

What classes are cmpiled with errors?

In which modules/dependencies are they located?

What kind of 'tweaks' of the modules configuration in IDEA do you do?

 

Can you point exactly what dependency causes problems?

If you can send the project - that is great.

 

Please create a bug report and attach the project (you can set visibility so only our teem sees it).

If you do so, please describe your problem and answer these questions there.

 

Thanks

Bernard AMADE Newbie 66 posts since
Dec 8, 2011
Currently Being Moderated
Jan 18, 2012 8:24 PM in response to: Anton Makeev
Re: Maven support?

thanks for replying

sorry for  not being clear

 

--------------------------

 

I still cannot understand the problem you are having.

What classes are cmpiled with errors?

In which modules/dependencies are they located?

 

>>> I have two of our own classes that are ok for the IDEA sources (I mean import are not red and everything looks ok)

>>> but compiling fires the abovementionned message

>>> those classes are in let's say module A and refer to classes in module B

>>> the message is about classes in module B

>>>> so again: class Y in module A import class X in module B that looks ok when editing but compiling crashes

>>>> this is not the first time that is happening (though with a differnet flavour of crash) and I suspect that it is the maven vision that is at fault.

 

 

What kind of 'tweaks' of the modules configuration in IDEA do you do?

>>> I am trying to play with the "project structure/dependencies" default does not work, sometimes modifying this data works wonder (except in that case!)

 

Can you point exactly what dependency causes problems?

>>> If I knew I would be happy

 

If you can send the project - that is great.

>>> I can do that: how? (it will be a BIG zip!)

 

MODIFIED: in ftp site it is LsstCamera.zip

the .idea is bound to Lsst directory

the culprit is the org-lss-ccs-shutter/trunk module

a make of this module will reproduce the error

 

thanks

 

 

 

------------------------------

Bernard AMADE Newbie 66 posts since
Dec 8, 2011
Currently Being Moderated
Jan 24, 2012 11:41 AM in response to: Bernard AMADE
Re: Maven support?

so I wrote an "official" question about that. (I found a precise example of dysfunctionning correlation between Maven and IDEA, there are many more I coud not pinpoint and that block me)

here is the example

 

module A -> (depends on) moduleX

moduleB -> moduleY -> moduleX

all versions descriptions are correct in pom.xml .... except that in the pom.xml of moduleY there is an error : a <Profile> references a dependency with an erroneous version number to moduleZ

in that case: maven does compile/run but IDEA gets stuck : code in moduleA do not "see" code in moduleB

for sure this is an error from the people that wrote the poms ... my suggestion was that if IDEA detects such an inconsistency then it issues a report!

thanks

Bernard AMADE Newbie 66 posts since
Dec 8, 2011
Currently Being Moderated
Jan 24, 2012 7:49 PM in response to: Bernard AMADE
Re: Maven support?

funny thing is that in my bug/feature report I thought I precised that the problem is about incorrect maven configuration.....

and the reply is "If you are sure the configuration is correct, please attach a sample project that shows the problem."

apparently I was not clear enough ....

so I'll restate the problem:

----> in complex maven configurations, if there is an anomaly (for instance an inconsistency about version due to "diamond dependencies") then maven does not notice but IDEA blocks

blocking  may be a normal and coherent behaviour .... except that we are not notified of the problem  (and we spend hours thinking there is a bug in IntellIj and annoying maintainers )

so this is more a feature request: if the IDEA "vision" of maven dependencies has a problem it should notify the user.

thanks

Anton Makeev JetBrains 1,294 posts since
Dec 19, 2006
Currently Being Moderated
Jan 24, 2012 7:58 PM in response to: Bernard AMADE
Re: Maven support?

Bernand,

the best way to show us the problem is to submit a sample projects. So far all your descriptions are too general and we cannot do much about it.

Bernard AMADE Newbie 66 posts since
Dec 8, 2011
Currently Being Moderated
Jan 24, 2012 8:02 PM in response to: Anton Makeev
Re: Maven support?

already done: see previous message

I can do another copy with a modification that starts the feature

Bernard AMADE Newbie 66 posts since
Dec 8, 2011
Currently Being Moderated
Jan 31, 2012 2:31 PM in response to: Bernard AMADE
Re: Maven support?

well for those who may have maven configuration that is so FUBR that it crashes IDEA here are 2 tips:

  - delete .idea of the project , re create project , re-import all maven modules

- sometimes  IDEA does not  "see" the latest modifications on maven description when importing a maven module : on MAC reboot the machine! (it then does work!)

Bernard AMADE Newbie 66 posts since
Dec 8, 2011
Currently Being Moderated
Jan 31, 2012 4:50 PM in response to: Bernard AMADE
Re: Maven support?

everytime I introduce a new module in the project I spend many hours trying to fix the fact that IDEA is lost in POMs

now again stuck by code in a module that does not want to acknowledge code in another module (though the other module is in POM dependencies and .iml dependencies!)

so now I am obliged to use Netbeans which works correctly , tells me about the POM structure graph and so on ...

well I sure prefer to use IDEA but I can't be a masochist all the time

So I keep IDEA for Groovy code and will be obliged to use Netbeans for the other java codes....

my suggestion: again try to trace the Maven dependencies and signal those who are faulty and may block IDEA !

More Like This

  • Retrieving data ...