- This topic has 26 replies, 2 voices, and was last updated 12 years, 4 months ago by support-tony.
-
AuthorPosts
-
brgilesMemberI recently created a multi-module maven project without a problem. (One parent POM, 7 children). I didn’t have any problems with individual modules having their own dependencies, etc.
I committed it to SVN. The commit included the .classpath and .project files.
I deleted the projects and chcked them out again in order to have a clean copy to work with.
None of the maven libraries have reappeared. I’ve checked the .classpath and .project – they all have a maven nature and the maven library specified but the actual maven library item in the package hierarchy is missing. All of the dependencies are flagged as ‘class not found’. This happens with both full trees and checking out individual modules.
I can build the project from the command line so I know the project itself is good. It’s definitely something weird in the MyEclipse environment.
I’ve also tried project > maven4myeclipse > update project configuration on the parent project (which includes the source for all children and all of the nested source directories are marked as such) and get a “Path must include project and resource name: /” error message. I don’t know where this comes from since that project includes the parent pom.
I just updated to MyEclipse 10.5.
support-tonyKeymasterbrgiles,
I’m not totally sure I understand your situation. When you refer to “maven library item in the package hierarchy” do you mean the “Maven Dependencies” library shown in the Package Explorer for the project?
I’m also not clear whether the multi-module nature of your set of projects is relevant as you wrote, “This happens with both full trees and checking out individual modules.” Does this mean that you see the problem with any individual maven project checked out from SVN? I’ve tried a simple maven project stored in SVN but had no problem.
Could you also, please, post or attach information from MyEclipse->Installation Summary->Details and attach the .log file (you will have to rename it to something like log.txt) from the workspace .metadata folder, after first clearing it and replicating your problem?
brgilesMemberYes, the “Maven Dependencies” disappeared and none of the classes in my pom.xml file are shown in the classpath.
I tried checking out individual modules in case the system was confused because of multiple pom.xml files. Unlikely but I wanted to eliminate the possibility.
Files attached. You can get the source code at http://otterca.googlecode.com/.
Attachments:
You must be logged in to view attached files.
support-tonyKeymasterbrgiles,
Thanks for the details.
You appear to have attached information from Help->About MyEclipse->Installation Details, rather than the information I asked for. There is some overlap but please attach information from MyEclipse->Installation Summary->Installation Details, to make sure I’m not missing anything.
I still can’t replicate either of your problems – I’m just trying with freestanding maven projects. However, in some cases, the build path is altered slightly, though it doesn’t appear to cause problems. Please attach both versions of the .classpath file, from the project folder; the one as checked out and the one as stored in the SVN repository, so I can see what has been altered, if anything, during the checkout.
With the log file, does in cover the time when you checked out the project from SVN? If not, please clear the log, then check out a maven project from SVN and attach the resulting .log file to see if there are any relevant errors that occurred during the checkout.
Can you try recreating the checkout problem with a simple project and attaching that project here? That would help us investigate the issue.
Though this should not be necessary, you can also try checking out the project another way. Go to the SVN repository browser, right click on a maven project and select “Check out as Maven Project”. As I say, this should not be necessary, as the eclipse project has the maven nature anyway (and so can be checked out simply as an eclipse/MyEclipse project), but it will be interesting to see if that method works (it should).
brgilesMemberI think I didn’t get the other information since there was no easy way to copy it to the clipboard or otherwise save it, vs. the other data.
I don’t know what you mean by ‘check out as a maven project’. When I’m in the SVN Exploring perspective and tell it to check out the source tree it doesn’t give me any options. I’ve included the .log file after doing that but don’t see anything in it. (REALLY don’t see anything in it – it’s odd but the project does show up.)
I tried creating a new maven project from scratch. The “Maven Dependencies” entry didn’t appear but I don’t know how significant that is. I tried adding a dependency butfor some reason both maven repositories (local, standard) aren’t responding and I don’t have time to investigate that before heading into work.
Attachments:
You must be logged in to view attached files.
brgilesMemberI’ve had a chance to look at this a little more. Another existing project in this workspace still shows the “Maven Dependencies” entry. A newly created project also shows that entry after adding a dependency. It doesn’t help when I add a new dependency to the project with a problem.
I think I mentioned that the maven4myeclipse > ‘update project configuration’ results in a “Path must include project and resource name: /” error message. The makes it sound like a maven issue but I’ve had no problem building the project at the command line or via jenkins so that seems unlikely.
support-tonyKeymasterbrgiles,
Thanks for the information and for trying with a new Maven project. Can you share that project to SVN, delete it from the workspace and check it out? If the problem occurs with that, then please attach a zip of the project for us to check.
As you’ve seen, a dependency must be added for the Maven Dependencies library to show up in the Package Explorer.
The “Check out as Maven Project” that I mentioned is a menu item when you right click on the project in the SVN explorer. I can’t check right now, as I’m not on my normal system, but I think it’s right above or below the other “Check out” menu item. It may not appear if you don’t have the Subclipse connector for maven installed. The connector may be installed by, instead of the SVN repository explorer, using File->Import->Maven4MyEclipse->Check out Maven Projects from SCM; in the dialog that pops up, there is a link about adding connectors, click on that link and scroll to near the bottom to find the Subclipse connector. You will have to restart after installing it. Once the connector is installed, you can check out via File->Import or via the SVN Repository Explorer.
The lack of the connector should not cause the problem you’re seeing as it is meant for checking out straight maven projects from SVN and should not be needed for checking out eclipse projects that are maven enabled. However, it might be affecting something on your system.
brgilesMemberChecked in that project to the same repository (since there may be a difference if I use my internal svn repository), deleted project, and when I try to go to SVN Repository Exploring perspective I get:
Unable to read workspace state
Could not find view: org.tigris.subversion.subclipse.ui.repository.RepositoriesView
Could not find view: org.tigris.subversion.subclipse.ui.annotations.AnnotateView
Could not find view: org.eclipse.mylyn.tasks.ui.views.repositoriesthis hadn’t been a problem earlier. I was able to open the SVN Repositories view. Again no ‘check out as maven project’ but when I checked it out it still has the maven nature and the Maven Dependencies item is present.
I’ve cleared the project again and checked it out and noticed something odd – when I’m in project (right click) > maven4myeclipse > update project configuration I actually get the update maven dependencies dialog. This also happens if I select by the keyboard instead of the mouse.
The other thing I tried was creating a new module under the parent pom. Again it didn’t show the Maven Dependencies item even though I added explicit dependencies.
brgilesMemberI had a chance to add the connector. Same problem when I import the project – no Maven Dependency entry and none of the jars are imported.
I’ve also been able to duplicate the behavior on an older 10.0 system that I haven’t upgraded.
brgilesMemberOkay, created new maven project (pom) with two modules. Added spring dependency to one module, hibernate dependency to the other. Neither “Maven Dependency” showed up. Added spring dependency to parent pom.xml just to rule out the possibility that we need to have dependencies in both parent and child, again no dependencies show up.
I haven’t populated the project sufficiently to check this but with the other project it builds cleanly from the command line so I know it’s a well-formed maven project.
You said it worked for you so it can’t be some weirdness because the top-level pom.xml has packaging of pom instead of jar.
Checked in at http://otterca.googlecode.com/svn/maven-test .
support-tonyKeymasterbrgiles,
So, it seems that, for you, the common theme for a project that exhibits this problem is that it has a parent project. Is that right?
I’ve tried a number of combinations, with stand-alone projects and parent/child projects but have not been able to replicate the problem except in one case. That was when importing the parent and child as maven projects (not as eclipse projects) from the file system but, in that case, the child had an error which required me to update the project configuration, after which the Maven Dependencies library appeared in the Package Explorer. Actually, no libraries appeared at all in the Package Explorer, including the JRE library, until I’d updated the project configuration. But you said you’d done such an update without it having an effect.
You provided an SVN URL in your last post. Was that meant to be the sample project(s)? There is nothing in the project; has it been committed there? I think that sharing it without a commit will result in an empty SVN location. As an alternative, you can attach the project here and I can work from that.
Have you tried importing maven projects from the file system? Import->Maven4MyEclipse->Existing Maven Projects or Import->General->Existing Projects into Workspace, depending on whether they are eclipse projects or not.
brgilesMemberYes, it definitely seems to be related to whether or not the project has a parent. It doesn’t matter if I check out the child as its own project.
I tried the ‘import existing maven project’ and saw two differences:
1) the top-level Maven Dependencies appeared once and had some content. None of the children have this entry though. It didn’t show up in subsequent project imports.
2) I get a warning dialog
Setup Maven plugin connectors
Discover and map Eclipse plugins to Maven plugin goal executions.
Maven Build | Action
maven-compiler-plugin:2.4:compile | Resolve Later
maven-compiler-plugin:2.4:testCompile | Resolve Later
maven-jar-plugin:2.4:jar | Resolve LaterAll items on the left have a > symbol and expend to list every child module.
I tried clicking on ‘auto select’, to no effect. I don’t know what the other possible actions are.
Now all of the projects give me
Errors running builder ‘Maven Project Builder’ on project ‘(child)’
path must include project and resource name: /When I try project > (right click) maven4myeclipse > update project configuration I still only get that error for four modules (top-level, crypto api, registration and certificate authorities)
I hope to have more later.
brgilesMemberSomething from http://www.errorhelp.com/search/details/170008/path-must-include-project-and-resource-name – I am using a short artifact name, e.g., otterca-crypto-api, but a longer project name, e.g., OtterCA Cryptographic API. When I check out the project the myeclipse projects use the maven project name, not the maven artifact id. I didn’t see a change when I used ‘refactor’ to change the name of the project but maybe I need to do something else.
The other thought was that the root of my SVN tree is ‘trunk’, not ‘trunk/otterca’, so that might lead to some confusion. However you said that you don’t have a problem on your system so that seems to rule out both possibilities.
support-tonyKeymasterbrgiles,
I’m not sure what the “Discover and map Eclipse plugins to Maven plugin goal executions.” refers to but I have always seen that with a maven import and have not seen any problems by leaving them at the default setting. We should have a better answer for you later.
I’ve raised a bug for this issue so we can take a more detailed look and track it, though we have, as yet, been unable to replicate. I see that the public SVN repository you pointed to in an earlier post has now had your test project committed. I tried that and could still not replicate the problem.
Would it be possible for you to try separating the parent and child projects (with your test) into separate file hierarchies? This shouldn’t be an issue, but, at this stage, want to get as much information as possible that might help us track this down. I’ve tried it both ways, myself, without seeing a problem either way.
So, let me recap on your main problem, to make sure we have it right.
When checking out parent and child projects from SVN (using subclipse), either using plain checkout or the maven specific checkout, you see no Maven Dependencies library in the child projects, even though they have dependencies in the pom. Maven builds them cleanly. Also, you get this problem when importing maven parent/child projects from the file system. This happens on projects that were created in MyEclipse with no problem until shared or “exported”. Is that right.
A screenshot of the Package Explorer view that you see would be useful.
Another bit of information that we don’t have is your particular flavor of Linux. Could you provide that information, please? I don’t know if it is relevant but it may help.
I don’t think you’ve mentioned if the lack of the Maven Dependencies library causes issues with compilation. Presumably the only problem is that you can’t see the dependencies in the Package Explorer. Is that right?
I couldn’t see any obvious issues with conflicting plug-ins but, if possible, could you try a separate install of 10.5, adding no other plug-ins, and see if you get the same issue? This is probably grasping at straws here but this is something I would try.
Sorry you are seeing this issue so consistently but we’ll keep trying to figure it out.
brgilesMemberUbuntu 12.4
I usually don’t see the parent Maven Dependencies either but that may be due to the lack of any dependencies at the top level.
Command-line maven works but I can’t compile within MyEclipse.
That simple test project, annoyingly, did start working last night. I have no idea what changed.
I tried knocking down the parent’s modules to just one, an API module, but the problem persisted.
I have tried checking out just the child project, still doesn’t work.
I once saw a message referring to missing path and resource /and/ something about missing maven-jar-plugin. That was a valid observation – I had ‘jar’ packaging but didn’t include that plugin in the <build> stanza, but I still have problems. I don’t know if the ongoing error messages are also truncated.
I’ll try go get to the other questions later, wildfires permitting.
Attachments:
You must be logged in to view attached files. -
AuthorPosts