You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by crowne <cr...@gmail.com> on 2009/01/12 12:02:09 UTC

Re: Mvn eclipse:eclipse - strange M2_REPO settings

I am experiencing this too, and I found a jira for this issue which was
closed but I think should be reopened.
http://jira.codehaus.org/browse/MECLIPSE-408

Regards,
Neil Crow.



Ian Orford wrote:
> 
> Maven 2.0.9
> maven-eclipse-plugin 2.5.1
> Eclipse 3.4.1
>  
> Some time ago, my "mvn eclipse:eclipse" commands started misbehaving. I
> had been using it for ages previously.
>  
> My repo on my development workstation is in C:\Dev\.m2\repository.
>  
> The .classpath files that are generated when I run "mvn eclipse:eclipse"
> on a project include the whole path. For example, one of the entries is:
>  
> <classpathentry kind="var" 
>  
> path="M2_REPO/dev/.m2/repository/org/springframework/spring/2.5.1/spring
> -2.5.1.jar" 
>  
> sourcepath="M2_REPO/dev/.m2/repository/org/springframework/spring/2.5.1/
> spring-2.5.1-sources.jar"/>
>  
> So for this to work, I have to set my M2_REPO variable to just "C:/" and
> not the path to the repo.
> I'm not sure what I upgraded that caused this behaviour.
>  
> Anyone have any clues?
>  
> Many thanks,
> Ian
> 

-- 
View this message in context: http://www.nabble.com/Mvn-eclipse%3Aeclipse---strange-M2_REPO-settings-tp20541566p21412358.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Mvn eclipse:eclipse - strange M2_REPO settings

Posted by crowne <cr...@gmail.com>.

baerrach wrote:
> 
> I've re-opened it.
> 
> I haven't had the chance to look in detail at the problem.
> 
> If there are enough steps to reproduce the problem then there is a
> better chance of it getting fixed.
> 

I've resolved my issue, and commented on the jira as follows:

OK, I have fixed my configuration ...
This is a windows problem only.
The problem was in my C:\Documents and Settings\uid\.m2\settings.xml

where I had defined a value for localRepository as follows:
<localRepository>/Documents and
Settings/uid/.m2/repository</localRepository>

This value happens to be similar to the default, although the default on
windows uses a C:\ prefix.
The C:\ prefix turned out to be rather important, as this is one of the ways
that java.io.Win32FileSystem determines whether the path is absolute or not,
the other way that is accepted as absolute is if the path startsWith a
double slash \\.
A single slash [how I had entered it] is not an absolute path, and this
caused IdeUtils.toRelativeAndFixSeparator() to duplicate the basedir on the
fileToAdd.
Further on in this method, the duplicated basedir is removed, and the result
is returned as a relative path, however due to the initial duplication, the
path that was returned was still absolute (even if Win32FileSystem doesn't
think so due to lack of C:\ or \\).

So the quick answer of how I fixed this was to comment out my
localRepository in my settings.xml and use the default generated value.

Cheers,
Neil.
-- 
View this message in context: http://www.nabble.com/Mvn-eclipse%3Aeclipse---strange-M2_REPO-settings-tp20541566p21553641.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Mvn eclipse:eclipse - strange M2_REPO settings

Posted by Barrie Treloar <ba...@gmail.com>.
On Mon, Jan 12, 2009 at 9:32 PM, crowne <cr...@gmail.com> wrote:
>
> I am experiencing this too, and I found a jira for this issue which was
> closed but I think should be reopened.
> http://jira.codehaus.org/browse/MECLIPSE-408

I've re-opened it.

I haven't had the chance to look in detail at the problem.

If there are enough steps to reproduce the problem then there is a
better chance of it getting fixed.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org