| Summary: | [patch] Regression in Maven Import on checkout | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Mike Youngstrom <youngm> | ||||||||||||
| Component: | m2e | Assignee: | Project Inbox <m2e.core-inbox> | ||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||
| Severity: | major | ||||||||||||||
| Priority: | P3 | CC: | fbricon, frank.jakop, igor, sslavic, tompik, youngm | ||||||||||||
| Version: | unspecified | ||||||||||||||
| Target Milestone: | --- | ||||||||||||||
| Hardware: | PC | ||||||||||||||
| OS: | Windows Server 2008 | ||||||||||||||
| Whiteboard: | |||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Mike Youngstrom
Created attachment 218403 [details]
Test Project
This simple patch appear to fix the issue. I'll create a test too. One question though. The way this is currently written works fine for SVN repositories. However, for git repositories where the repo has already been cloned to the git working and we're essentially just importing the cloned directory do we really want to be renaming the cloned work directory? It seems like this directory renaming could cause problems for Git. Thoughts?
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java
index af0ee73..d5a8ea8 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java
@@ -133,7 +133,10 @@
String pomName = modulePath + "/" + IMavenConstants.POM_FILE_NAME; //$NON-NLS-1$
MavenProjectInfo projectInfo = newMavenProjectInfo(pomName, pomFile, model, parentInfo);
- projectInfo.setBasedirRename(getBasedirRename(projectInfo));
+ //We only want to optionally rename the base directory not any sub directory
+ if(parentInfo == null) {
+ projectInfo.setBasedirRename(getBasedirRename(projectInfo));
+ }
Map<String, Set<String>> modules = new LinkedHashMap<String, Set<String>>();
for(String module : model.getModules()) {
Created attachment 218406 [details]
Patch to m2e core
Created attachment 218407 [details]
Patch to m2e tests
Let me know what you think of these patches Igor. I hope this fix can be back ported to juno sr1. Mike Mike, the patch doesn't apply to master. Please rebase your repos and use git-format to create your patches (In reply to comment #6) > Mike, > > the patch doesn't apply to master. > Please rebase your repos and use git-format to create your patches git-format-patch Created attachment 218937 [details]
Patch to m2e core
Created attachment 218938 [details]
Patch to m2e tests
Sorry about that. I'm new to Git and I'm running windows so I'm trying to do this with egit. I hope I got it right this time. If I did for future reference I believe in eGit terms the proper patch type is an "Email" patch. We're experiencing this issue also with CVS and would really appreciate a port/targeting to juno SR1. Mike's patches applied (somehow) : core : http://git.eclipse.org/c/m2e/m2e-core.git/commit/?id=19462411f1cf58d6b1246463946d694201763449 tests : https://github.com/sonatype/m2e-core-tests/commit/b8eec911bda920d768a8e01712964c66f184c04c I still wasn't able to apply the patches cleanly with "git am", even "git am -3", so instead of going back and forth with Mike, I chose to use egit to apply them then run commands like : git commit -s --author="Mike Youngstrom <youngm@gmail.com>" --date="Fri, 6 Jul 2012 17:16:27 -0600" --message="[PATCH] Test to ensure we only rename the base project and not any of the sub projects. 384510" Thanks Mike. Thanks Fred, It would be nice to know how to create an appropriate patch with egit. I really don't want to install cygwin for git on my windows box unless I have no other option. :) Mike (In reply to comment #13) > Thanks Fred, > > It would be nice to know how to create an appropriate patch with egit. I > really don't want to install cygwin for git on my windows box unless I have no > other option. :) > EGit user list or forum is a better place to ask this kind of questions. Lets keep bugzilla for bug-related discussions. |