aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Enable dependency management is not working for me not even getting the maven folder created(eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Enable dependency management is not working for me not even getting the maven folder created(eclipse" Watch "Enable dependency management is not working for me not even getting the maven folder created(eclipse" New topic
Author

Enable dependency management is not working for me not even getting the maven folder created(eclipse

Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

I am not sure what to try, but I keep right clicking and selecting enable maven dependencies. That does nothing but it does give me all the new maven menu options.
So I then hit update dependencies, nothing happens, and then I hit update project configuration, still nothing.
The Maven folder does not even get created.

I am doing this at work, and the person who helped me said to try things in that order and it should work. Although he did have one extra step, which was that I needed to select 'enable nested modules', but I have been reading and found that this feature has been removed. Maybe that will help someone figure out why this is not working for me and provide an alternative to enabling nested modules?

Any ideas?


True wisdom is in knowing you know nothing - Socrates
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

Where are you doing this right-clicking? And what Maven menu options. Maven is a command line utility, so your question is probably related to some UI, and not to Maven itself.


JBoss In Action
Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

Right clicking on the project itself in the project explorer for eclipse. I probably should have mentioned this is the eclipse plugin for eclipse I am working with.

But is there a command line mvn command to update dependencies? I am connected to a work artefactory so I should be pulling the libraries in from that, but I am having no luck. I am able to do it on other random projects so I am definitely connected correctly to the artefactory. I am just un sure what to try. I don't expect I will find an answer here, because it is such a specific case I ave, and it could be so many problems. I am just swinging in the dark at this point because I have been at this for about 12 hours with no luck.

I did try a different maven plugin - Q4E. When I right clicked on the project and enabled dependency management it did seem to work, but my source folders all went away and the java classes were moved to some other folder (the errors were gone at this point, so it saw the jars I needed somewhere). Then when I right clicked on the folder that now held the java classes, and clicked build path -> make source folder, all my source folders were back but all with the errors again indicating no maven dependencies.



edit - When I run mvn install on this project it starts to download all the jars and such from my work artefactory:

Downloading: http://maven.work.com/artifactory/repo/commons-dbutils/commons-dbutils/1.1/commons-dbutils-1.1.jar
Downloading: http://maven.work.com/artifactory/repo/commons-collections/commons-collections/3.2/commons-collections-3.2.jar
Downloading: http://maven.work.com/artifactory/repo/vignette/vgn-appsvcs-cda/7.6/vgn-appsvcs-cda-7.6.jar
Downloading: http://maven.work.com/artifactory/repo/vignette/thirdparty-combined/7.6/thirdparty-combined-7.6.jar
Downloading: http://maven.work.com/artifactory/repo/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar
Downloading: http://maven.work.com/artifactory/repo/commons-codec/commons-codec/1.2/commons-codec-1.2.jar
Downloading: http://maven.work.com/artifactory/repo/javax/mail/mail/1.4/mail-1.4.jar

So it is obviously connecting to my work's artefactory (I replaced my job's name with the word 'work' there to protect myself from any NDA's). I do not understand though why the Maven source folder is not getting created, and putting all these jars in there though ><
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15624
    
  15

Maven cannot automatically determine dependencies. You have to define them yourself. There are 3 primary reasons:

1. One of Maven's strongest selling points is reduction of "jar hell" - Java's version of the infamous "DLL Hell". You can bulletproof a build by referencing a specific version of a jar, thereby eliminating possible problems where a future version of the same jar breaks something.

2. It is, alas, impossible to deduce an artifact's ID from the artifact itself. I would prefer that Maven would be consistent about using the upper-level package names as part of the artifact ID, but in fact, there's been a trend to do exactly the opposite, so that for a lot of artifacts end up as top-level items.

3. What would be the point of forcing a POM to include dependencies if the dependencies could have been automatically determined to begin with?


Customer surveys are for companies who didn't pay proper attention to begin with.
Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

Thanks for the info, I actually just read all of the maven documentation at the sonatype site, got some good info but still have not resolved my issue.

When I run a mvn clean build I get build success, but I also get a lot of warnings:

[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-jxr-plugin is missing.
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing.
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-pmd-plugin is missing.
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-changes-plugin is missing.
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-changelog-plugin is missing.


I read somewhere about a fix for this, but I do not believe this is causing my issues. I am just wanting to include all the info I can, but not all at once so as not to incur tldr's
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15624
    
  15

Yeah. These are all Maven plugins that you're tapping either explicitly (in the POM) or implicitly (just by existing). For the ones in your POM, you just need to add a version ID to the plugin artifact reference. Used to be that was more of an option. Now it's more of a requirement.
Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

Well, instead of opening the project as a new java project and trying to mavenize it, I went ahead and opened it as a new interconnected maven project (main piece + 3 modules) and that imported the dependencies just fine. It will work I guess, but I still want to know why I cannot seem to get it working the other way. Maybe this new bit of info will give someone an idea?

Thanks

edit - by the way, I tried it on a co worker's pc who was fortunate enough t get the 0.9 version of M2Eclipse, and he had the 'enable nested modules' feature... and it worked just fine, so that is definitely the reason I cannot get it working, I need to make happen whatever that particular feature does.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Enable dependency management is not working for me not even getting the maven folder created(eclipse
 
Similar Threads
maven / web inf
Maven: Gettng theParent folder of ${basedir}
Porting maven project to eclipse..... problem
does Maven support nested modules?
Publish to maven repository as "latest"