You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by "Nelligan, Steven M" <sn...@illinois.edu> on 2020/12/03 16:02:52 UTC

Moving the .M2 folder in Netbeans

I want to move the .m2 folder from my windows user's profile folder to be within my project folder.
i.e. C:\dev\Projects-Java8\.m2

In Netbeans \Options\Java\Maven I have the following configurations:
	Maven Home: C:\Program Files\apache-maven-3.6.3
	Default JDK: JDK 1.8
	Global Execution Options: -gs C:\dev\Projects-java8\.m2\settings.xml -s C:\dev\Projects-java8\.m2\settings.xml
	
If I build the project with the .m2 folder deleted from my window user's profile everything is working.

The problem is that the NetBeans IDE shows errors in the edit windows (red underline), since it cannot resolve the imports.
If I put a copy of the .m2 folder in my window user's profile, the red line disappear.

How do I configure Netbeans to have the edit window look in the redirected .m2 folder.

Thanks in advance,
Steve Nelligan




RE: Moving the .M2 folder in Netbeans

Posted by "Nelligan, Steven M" <sn...@illinois.edu>.
I already had the change to C:\dev\Projects-java8\.m2\setting.xml file made.  It did not solve the problem.
I tried to create the MAVEN_OPTS environment variable, but that did not work.
The symlink option worked...

Thanks for the help.

Steve


-----Original Message-----
From: Thomas Kellerer <sh...@gmx.net> 
Sent: Friday, December 4, 2020 7:08 AM
To: users@netbeans.apache.org
Subject: Re: Moving the .M2 folder in Netbeans

Nelligan, Steven M schrieb am 03.12.2020 um 17:02:
> I want to move the .m2 folder from my windows user's profile folder to be within my project folder.
> i.e. C:\dev\Projects-Java8\.m2
>
> In Netbeans \Options\Java\Maven I have the following configurations:
> 	Maven Home: C:\Program Files\apache-maven-3.6.3
> 	Default JDK: JDK 1.8
> 	Global Execution Options: -gs C:\dev\Projects-java8\.m2\settings.xml -s C:\dev\Projects-java8\.m2\settings.xml
>
> If I build the project with the .m2 folder deleted from my window user's profile everything is working.
>
> The problem is that the NetBeans IDE shows errors in the edit windows (red underline), since it cannot resolve the imports.
> If I put a copy of the .m2 folder in my window user's profile, the red line disappear.
>
> How do I configure Netbeans to have the edit window look in the redirected .m2 folder.

One obvious solution would be a symlink from %USERPROFILE%\.m2 to your project's .m2 folder

Another solution is to define an environment variable:

    MAVEN_OPTS="-Dmaven.repo.local=c:/dev/Projects-java8/.m2"

And as a third alternative, it is also possible to specify this in settings.xml

    <localRepository>c:/dev/Projects-java8/.m2</localRepository>

See https://datacadamia.com/maven/local for details

Thomas




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

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Moving the .M2 folder in Netbeans

Posted by Thomas Kellerer <sh...@gmx.net>.
Nelligan, Steven M schrieb am 03.12.2020 um 17:02:
> I want to move the .m2 folder from my windows user's profile folder to be within my project folder.
> i.e. C:\dev\Projects-Java8\.m2
>
> In Netbeans \Options\Java\Maven I have the following configurations:
> 	Maven Home: C:\Program Files\apache-maven-3.6.3
> 	Default JDK: JDK 1.8
> 	Global Execution Options: -gs C:\dev\Projects-java8\.m2\settings.xml -s C:\dev\Projects-java8\.m2\settings.xml
>
> If I build the project with the .m2 folder deleted from my window user's profile everything is working.
>
> The problem is that the NetBeans IDE shows errors in the edit windows (red underline), since it cannot resolve the imports.
> If I put a copy of the .m2 folder in my window user's profile, the red line disappear.
>
> How do I configure Netbeans to have the edit window look in the redirected .m2 folder.

One obvious solution would be a symlink from %USERPROFILE%\.m2 to your project's .m2 folder

Another solution is to define an environment variable:

    MAVEN_OPTS="-Dmaven.repo.local=c:/dev/Projects-java8/.m2"

And as a third alternative, it is also possible to specify this in settings.xml

    <localRepository>c:/dev/Projects-java8/.m2</localRepository>

See https://datacadamia.com/maven/local for details

Thomas




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

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Moving the .M2 folder in Netbeans

Posted by Davide Grandi <da...@email.it>.
 >Did you delete the .m2 folder in your users folder?

moved.
(and if a build lasts too long ... I look for a straw .m2 folder on disk)

     dg

On 04/12/2020 16:06, Nelligan, Steven M wrote:
> Did you delete the .m2 folder in your users folder?
>
> STEVEN M NELLIGAN
>
> -----Original Message-----
> From: Davide Grandi <da...@email.it>
> Sent: Friday, December 4, 2020 8:38 AM
> To: users@netbeans.apache.org
> Subject: Re: Moving the .M2 folder in Netbeans
>
> I've set the variable
>       set MAVEN_OPTS= -Duser.home=C:\sviluppo\user.home here, in file
>       C:\sviluppo\user.home\.m2\settings.xml
> I've setup a repository in
> <localRepository>/sviluppo/appdata/maven/current/repository</localRepository>
> (the real path on disk is in win style).
>
> Actually I've a main setup file
>       C:\sviluppo\bin\dg.cmd
> that I run when I start working (in a cmd.exe, of course, then nb => current netbeans, nb8 => the old one, ...).
>
> It works, but your mileage can vary.
>
> cheers,
>
>       Davide Grandi
>
> On 03/12/2020 17:02, Nelligan, Steven M wrote:
>> I want to move the .m2 folder from my windows user's profile folder to be within my project folder.
>> i.e. C:\dev\Projects-Java8\.m2
>>
>> In Netbeans \Options\Java\Maven I have the following configurations:
>> 	Maven Home: C:\Program Files\apache-maven-3.6.3
>> 	Default JDK: JDK 1.8
>> 	Global Execution Options: -gs C:\dev\Projects-java8\.m2\settings.xml
>> -s C:\dev\Projects-java8\.m2\settings.xml
>> 	
>> If I build the project with the .m2 folder deleted from my window user's profile everything is working.
>>
>> The problem is that the NetBeans IDE shows errors in the edit windows (red underline), since it cannot resolve the imports.
>> If I put a copy of the .m2 folder in my window user's profile, the red line disappear.
>>
>> How do I configure Netbeans to have the edit window look in the redirected .m2 folder.
>>
>> Thanks in advance,
>> Steve Nelligan
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
>> For additional commands, e-mail: users-help@netbeans.apache.org
>>
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>
> --
> Ing. Davide Grandi
> email    : davide.grandi@email.it
> mobile   : +39 339 7468 778
> linkedin : http://linkedin.com/in/davidegrandi
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
-- 
Ing. Davide Grandi
email    : davide.grandi@email.it
mobile   : +39 339 7468 778
linkedin : http://linkedin.com/in/davidegrandi


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

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


RE: Moving the .M2 folder in Netbeans

Posted by "Nelligan, Steven M" <sn...@illinois.edu>.
Did you delete the .m2 folder in your users folder?



STEVEN M NELLIGAN


-----Original Message-----
From: Davide Grandi <da...@email.it> 
Sent: Friday, December 4, 2020 8:38 AM
To: users@netbeans.apache.org
Subject: Re: Moving the .M2 folder in Netbeans

I've set the variable
     set MAVEN_OPTS= -Duser.home=C:\sviluppo\user.home here, in file
     C:\sviluppo\user.home\.m2\settings.xml
I've setup a repository in
<localRepository>/sviluppo/appdata/maven/current/repository</localRepository>
(the real path on disk is in win style).

Actually I've a main setup file
     C:\sviluppo\bin\dg.cmd
that I run when I start working (in a cmd.exe, of course, then nb => current netbeans, nb8 => the old one, ...).

It works, but your mileage can vary.

cheers,

     Davide Grandi

On 03/12/2020 17:02, Nelligan, Steven M wrote:
> I want to move the .m2 folder from my windows user's profile folder to be within my project folder.
> i.e. C:\dev\Projects-Java8\.m2
>
> In Netbeans \Options\Java\Maven I have the following configurations:
> 	Maven Home: C:\Program Files\apache-maven-3.6.3
> 	Default JDK: JDK 1.8
> 	Global Execution Options: -gs C:\dev\Projects-java8\.m2\settings.xml 
> -s C:\dev\Projects-java8\.m2\settings.xml
> 	
> If I build the project with the .m2 folder deleted from my window user's profile everything is working.
>
> The problem is that the NetBeans IDE shows errors in the edit windows (red underline), since it cannot resolve the imports.
> If I put a copy of the .m2 folder in my window user's profile, the red line disappear.
>
> How do I configure Netbeans to have the edit window look in the redirected .m2 folder.
>
> Thanks in advance,
> Steve Nelligan
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
--
Ing. Davide Grandi
email    : davide.grandi@email.it
mobile   : +39 339 7468 778
linkedin : http://linkedin.com/in/davidegrandi


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

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


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

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Moving the .M2 folder in Netbeans

Posted by Davide Grandi <da...@email.it>.
I've set the variable
     set MAVEN_OPTS= -Duser.home=C:\sviluppo\user.home
here, in file
     C:\sviluppo\user.home\.m2\settings.xml
I've setup a repository in
<localRepository>/sviluppo/appdata/maven/current/repository</localRepository>
(the real path on disk is in win style).

Actually I've a main setup file
     C:\sviluppo\bin\dg.cmd
that I run when I start working (in a cmd.exe, of course, then nb => 
current netbeans, nb8 => the old one, ...).

It works, but your mileage can vary.

cheers,

     Davide Grandi

On 03/12/2020 17:02, Nelligan, Steven M wrote:
> I want to move the .m2 folder from my windows user's profile folder to be within my project folder.
> i.e. C:\dev\Projects-Java8\.m2
>
> In Netbeans \Options\Java\Maven I have the following configurations:
> 	Maven Home: C:\Program Files\apache-maven-3.6.3
> 	Default JDK: JDK 1.8
> 	Global Execution Options: -gs C:\dev\Projects-java8\.m2\settings.xml -s C:\dev\Projects-java8\.m2\settings.xml
> 	
> If I build the project with the .m2 folder deleted from my window user's profile everything is working.
>
> The problem is that the NetBeans IDE shows errors in the edit windows (red underline), since it cannot resolve the imports.
> If I put a copy of the .m2 folder in my window user's profile, the red line disappear.
>
> How do I configure Netbeans to have the edit window look in the redirected .m2 folder.
>
> Thanks in advance,
> Steve Nelligan
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
-- 
Ing. Davide Grandi
email    : davide.grandi@email.it
mobile   : +39 339 7468 778
linkedin : http://linkedin.com/in/davidegrandi


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

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists