You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Orford, Ian" <Ia...@dkib.com> on 2008/11/17 14:44:10 UTC

Mvn eclipse:eclipse - strange M2_REPO settings

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


--
This e-mail is confidential and the information contained in it may be privileged.  It should not be read, copied or used by anyone other than the intended recipient.  If you have received it in error, please contact the sender immediately by telephoning +44 (0)20 7623 8000 or by return email, and delete the e-mail and do not disclose its contents to any person.  We believe, but do not warrant, that this e-mail and any attachments are virus free, but you must take full responsibility for virus checking.  Please refer to http://www.dresdnerkleinwort.com/disc/email/ and read our e-mail disclaimer statement and monitoring policy.

Dresdner Kleinwort is the trading name of the investment banking division of Dresdner Bank AG, and operates through Dresdner Bank AG, Dresdner Kleinwort Limited and their affiliated or associated companies. Dresdner Bank AG is a company incorporated in Germany with limited liability and registered in England (registered no. FC007638, place of business 30 Gresham Street, London EC2V 7PG), and is authorised by the German Federal Financial Supervisory Authority and authorised and subject to limited regulation by the Financial Services Authority ("FSA"). Details about the extent of our authorisation and regulation by the FSA are available from us on request.  Dresdner Kleinwort Limited is a company incorporated in England (registered no. 551334, registered office 30 Gresham Street, London EC2V 7PG), and is authorised and regulated by the FSA. 
--


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


Re: Mvn eclipse:eclipse - strange M2_REPO settings

Posted by crowne <cr...@gmail.com>.
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