Getting up and running with Maven
Hi all!
I've tried to import pom-files before but somehow I always fail. I revert to using mvn idea:idea which I know isn't supported and every now and then I get into huge problems having to re-do all module-files, running mvn clean like 100 times and finally being able to start working again.
(I'll start here and probably/hopefully end up with more follow up questions as I progress)
So, our set up is quite common although perhaps not by the book. We have a parent pom that is the parent pom for all other poms. We do this to get smaller poms and to be able to manage global dependencies easy. However unusal, it works perfect running maven standalone.
A first easy step would be to add just one single of our modules. This won't be enough but at least get me starting.
Eventually I'll need to add somewhere between 5 and 10 different modules so my choice is to create an empty new project and then add the modules as I need them
And here is the first real question. What is "Maven Home Directory"? I'm running ubuntu and finding the "Maven User Settings File" and "Local Repository" is no problem.
Sorry for being fuzzy
Please sign in to leave a comment.
I managed to find out the answer to my first question with some help from my collegues. Maven Home Directory is, on my system, /usr/share/maven2. With that set I can now run the lifecycles from within idea. Big step forward.
My immediate second question is: How can I access profiles? command line I would run "mvn install -Pdeploy" or "mvn install -Pcodegen"
I tried to add a second module through another pom file and I just wont work
It just seems to me that either our pom-structure isn't supported or the maven support somewhat flaky....
Thanks.
your reply is in this forum already, try a search
It sounds like you think I haven't tried that, I have.
If you know there is an answer I'm sure you've just seen it. Why not just post a link to it and be helpful instead of, well.. not helpful.
I have to agree the search feature for this new forum is less pleasant to use than the former one.
However ... http://www.jetbrains.net/devnet/search.jspa?resultTypes=DOCUMENT&resultTypes=MESSAGE&resultTypes=COMMUNITY&resultTypes=TASK&resultTypes=PROJECT&resultTypes=SOCIAL_GROUP&resultTypes=COMMENT&peopleEnabled=true&q=maven+pom+packaging
will bring you some interesting links
http://www.jetbrains.net/devnet/message/5221766#5221766
http://www.jetbrains.net/devnet/message/5231689#5231689
this might also be worth a read
http://maven.apache.org/pom.html#Aggregation
I'm now trying a multi-project pom and it seems to work alright. I'm still building outside IDEA so the about 1 millon errors I get on project open doesn't bother me, as long as I find all the sources and can work with them I'm happy. The think I noticed that is less then optimal is:
So, I'm happy but not satisfied. I'd really like to just open up all my pom-files and "have it work".
Thanks anyway.
not sure it will help you, but my "workspace pom" is not a parent pom of it's modules.
From a filesystem perspective, they're all children of the same parent
ex :
AA_workspace_subject1
pom.xml : this is the packaging=pom
module1 : this is a submodule
module2 : this is another submodule
And my AA_workspace_subject1's pom includes module1 and module2 as modules.
I can have multiple workspaces that include different projects depending on the subject I'm working on.
This works mostly fine for me, but won't help you if you need to specify profiles, as I believe it's not possible anymore to specify a profile at project import