You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by NGUYEN Cong Kinh <co...@it-sudparis.eu> on 2009/10/07 17:14:36 UTC

[Maven's memory] How to avoid adding the MAVEN_OPTS variable?

Hello everybody,

Is there anyway to configure MAVEN_OPTS from the POM file (no variable)? 
For example, I want to configure Maven's memory is 768m. But I don't 
want to add the MAVEN_OPTS variable in the environment. This is possible 
to configure my POM? If yes, please send to me how to do this.

Thanks in advance,
Kinh

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


Re: [Maven's memory] How to avoid adding the MAVEN_OPTS variable?

Posted by David Hoffer <dh...@gmail.com>.
Right, maven would have to fork a new vm for the project.

On Wed, Oct 7, 2009 at 10:21 AM, Edelson, Justin <
Justin.Edelson@mtvstaff.com> wrote:

> No. Nor could their be, at least for the case you're describing. Maven's
> JVM has already started by the time it parses the POM. For plugins which
> fork a new VM, you may be able to provide these options. For example:
> http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-with-memory-enhancements.html
> .
>
> Justin
>
> -----Original Message-----
> From: NGUYEN Cong Kinh [mailto:cong_kinh.nguyen@it-sudparis.eu]
> Sent: Wednesday, October 07, 2009 12:07 PM
> To: Maven Users List
> Subject: Re: [Maven's memory] How to avoid adding the MAVEN_OPTS variable?
>
> Hello Paul,
>
> In fact, I don't want to set this. My question is that how to directly do
> this in my POM?
>
> Kinh
>
> Paul Benedict a écrit :
> > You could set it in your mvn.bat, right?
> >
> > On Wed, Oct 7, 2009 at 10:14 AM, NGUYEN Cong Kinh
> > <co...@it-sudparis.eu> wrote:
> >
> >> Hello everybody,
> >>
> >> Is there anyway to configure MAVEN_OPTS from the POM file (no
> >> variable)? For example, I want to configure Maven's memory is 768m.
> >> But I don't want to add the MAVEN_OPTS variable in the environment.
> >> This is possible to configure my POM? If yes, please send to me how to
> do this.
> >>
> >> Thanks in advance,
> >> Kinh
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: [Maven's memory] How to avoid adding the MAVEN_OPTS variable?

Posted by "Edelson, Justin" <Ju...@mtvstaff.com>.
No. Nor could their be, at least for the case you're describing. Maven's JVM has already started by the time it parses the POM. For plugins which fork a new VM, you may be able to provide these options. For example: http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-with-memory-enhancements.html.

Justin

-----Original Message-----
From: NGUYEN Cong Kinh [mailto:cong_kinh.nguyen@it-sudparis.eu] 
Sent: Wednesday, October 07, 2009 12:07 PM
To: Maven Users List
Subject: Re: [Maven's memory] How to avoid adding the MAVEN_OPTS variable?

Hello Paul,

In fact, I don't want to set this. My question is that how to directly do this in my POM?

Kinh

Paul Benedict a écrit :
> You could set it in your mvn.bat, right?
>
> On Wed, Oct 7, 2009 at 10:14 AM, NGUYEN Cong Kinh 
> <co...@it-sudparis.eu> wrote:
>   
>> Hello everybody,
>>
>> Is there anyway to configure MAVEN_OPTS from the POM file (no 
>> variable)? For example, I want to configure Maven's memory is 768m. 
>> But I don't want to add the MAVEN_OPTS variable in the environment. 
>> This is possible to configure my POM? If yes, please send to me how to do this.
>>
>> Thanks in advance,
>> Kinh
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>   


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


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


Re: [Maven's memory] How to avoid adding the MAVEN_OPTS variable?

Posted by Paul Benedict <pb...@apache.org>.
You can't and you shouldn't. The POM describes a Project, not the Java
environment for Maven.

On Wed, Oct 7, 2009 at 11:07 AM, NGUYEN Cong Kinh
<co...@it-sudparis.eu> wrote:
> Hello Paul,
>
> In fact, I don't want to set this. My question is that how to directly do
> this in my POM?
>
> Kinh
>
> Paul Benedict a écrit :
>>
>> You could set it in your mvn.bat, right?
>>
>> On Wed, Oct 7, 2009 at 10:14 AM, NGUYEN Cong Kinh
>> <co...@it-sudparis.eu> wrote:
>>
>>>
>>> Hello everybody,
>>>
>>> Is there anyway to configure MAVEN_OPTS from the POM file (no variable)?
>>> For
>>> example, I want to configure Maven's memory is 768m. But I don't want to
>>> add
>>> the MAVEN_OPTS variable in the environment. This is possible to configure
>>> my
>>> POM? If yes, please send to me how to do this.
>>>
>>> Thanks in advance,
>>> Kinh
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: [Maven's memory] How to avoid adding the MAVEN_OPTS variable?

Posted by NGUYEN Cong Kinh <co...@it-sudparis.eu>.
Hello Todd,

This is other thing.

Thank you,
Kinh


Todd Thiessen a écrit :
> I believe the compiler plugin does what you want.
>
> http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-with-memory-enhancements.html
>
> ---
> Todd Thiessen
>  
>
>   
>> -----Original Message-----
>> From: NGUYEN Cong Kinh [mailto:cong_kinh.nguyen@it-sudparis.eu] 
>> Sent: Wednesday, October 07, 2009 12:07 PM
>> To: Maven Users List
>> Subject: Re: [Maven's memory] How to avoid adding the 
>> MAVEN_OPTS variable?
>>
>> Hello Paul,
>>
>> In fact, I don't want to set this. My question is that how to 
>> directly do this in my POM?
>>
>> Kinh
>>
>> Paul Benedict a écrit :
>>     
>>> You could set it in your mvn.bat, right?
>>>
>>> On Wed, Oct 7, 2009 at 10:14 AM, NGUYEN Cong Kinh 
>>> <co...@it-sudparis.eu> wrote:
>>>   
>>>       
>>>> Hello everybody,
>>>>
>>>> Is there anyway to configure MAVEN_OPTS from the POM file (no 
>>>> variable)? For example, I want to configure Maven's memory 
>>>>         
>> is 768m. 
>>     
>>>> But I don't want to add the MAVEN_OPTS variable in the 
>>>>         
>> environment. 
>>     
>>>> This is possible to configure my POM? If yes, please send 
>>>>         
>> to me how to do this.
>>     
>>>> Thanks in advance,
>>>> Kinh
>>>>
>>>>
>>>>         
>> ---------------------------------------------------------------------
>>     
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>>     
>>>>         
>>>       
>> ---------------------------------------------------------------------
>>     
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>   
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>   


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


Re: [Maven's memory] How to avoid adding the MAVEN_OPTS variable?

Posted by David Hoffer <dh...@gmail.com>.
And the surefire plugin support this:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <forkMode>once</forkMode>
                    <argLine>-Xmx1024m -XX:MaxPermSize=128M</argLine>
                </configuration>
</plugin>

But I don't think you can for maven itself.  I too, at times, wished there
was a way because otherwise we have to set the maven opts to the worse case
for all our poms.

-Dave

On Wed, Oct 7, 2009 at 10:19 AM, Todd Thiessen <th...@nortel.com> wrote:

> I believe the compiler plugin does what you want.
>
>
> http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-with-memory-enhancements.html
>
> ---
> Todd Thiessen
>
>
> > -----Original Message-----
> > From: NGUYEN Cong Kinh [mailto:cong_kinh.nguyen@it-sudparis.eu]
> > Sent: Wednesday, October 07, 2009 12:07 PM
> > To: Maven Users List
> > Subject: Re: [Maven's memory] How to avoid adding the
> > MAVEN_OPTS variable?
> >
> > Hello Paul,
> >
> > In fact, I don't want to set this. My question is that how to
> > directly do this in my POM?
> >
> > Kinh
> >
> > Paul Benedict a écrit :
> > > You could set it in your mvn.bat, right?
> > >
> > > On Wed, Oct 7, 2009 at 10:14 AM, NGUYEN Cong Kinh
> > > <co...@it-sudparis.eu> wrote:
> > >
> > >> Hello everybody,
> > >>
> > >> Is there anyway to configure MAVEN_OPTS from the POM file (no
> > >> variable)? For example, I want to configure Maven's memory
> > is 768m.
> > >> But I don't want to add the MAVEN_OPTS variable in the
> > environment.
> > >> This is possible to configure my POM? If yes, please send
> > to me how to do this.
> > >>
> > >> Thanks in advance,
> > >> Kinh
> > >>
> > >>
> > ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >> For additional commands, e-mail: users-help@maven.apache.org
> > >>
> > >>
> > >>
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: [Maven's memory] How to avoid adding the MAVEN_OPTS variable?

Posted by Todd Thiessen <th...@nortel.com>.
I believe the compiler plugin does what you want.

http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-with-memory-enhancements.html

---
Todd Thiessen
 

> -----Original Message-----
> From: NGUYEN Cong Kinh [mailto:cong_kinh.nguyen@it-sudparis.eu] 
> Sent: Wednesday, October 07, 2009 12:07 PM
> To: Maven Users List
> Subject: Re: [Maven's memory] How to avoid adding the 
> MAVEN_OPTS variable?
> 
> Hello Paul,
> 
> In fact, I don't want to set this. My question is that how to 
> directly do this in my POM?
> 
> Kinh
> 
> Paul Benedict a écrit :
> > You could set it in your mvn.bat, right?
> >
> > On Wed, Oct 7, 2009 at 10:14 AM, NGUYEN Cong Kinh 
> > <co...@it-sudparis.eu> wrote:
> >   
> >> Hello everybody,
> >>
> >> Is there anyway to configure MAVEN_OPTS from the POM file (no 
> >> variable)? For example, I want to configure Maven's memory 
> is 768m. 
> >> But I don't want to add the MAVEN_OPTS variable in the 
> environment. 
> >> This is possible to configure my POM? If yes, please send 
> to me how to do this.
> >>
> >> Thanks in advance,
> >> Kinh
> >>
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >>     
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

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


Re: [Maven's memory] How to avoid adding the MAVEN_OPTS variable?

Posted by NGUYEN Cong Kinh <co...@it-sudparis.eu>.
Hello Paul,

In fact, I don't want to set this. My question is that how to directly 
do this in my POM?

Kinh

Paul Benedict a écrit :
> You could set it in your mvn.bat, right?
>
> On Wed, Oct 7, 2009 at 10:14 AM, NGUYEN Cong Kinh
> <co...@it-sudparis.eu> wrote:
>   
>> Hello everybody,
>>
>> Is there anyway to configure MAVEN_OPTS from the POM file (no variable)? For
>> example, I want to configure Maven's memory is 768m. But I don't want to add
>> the MAVEN_OPTS variable in the environment. This is possible to configure my
>> POM? If yes, please send to me how to do this.
>>
>> Thanks in advance,
>> Kinh
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>   


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


Re: [Maven's memory] How to avoid adding the MAVEN_OPTS variable?

Posted by Ivalo <iv...@iki.fi>.
As you see using these command files (mavenrc , .mavenrc or 
mavenrc_pre.bat) this is nothing to do with Maven plugins, the command 
files are called mvn command files itself.
So every time you execute mnv command the set MAVEN_OPTS are effective.

Markku

Paul Benedict wrote:
> Just so you guys know, if you use a Maven plugin to set MAVEN_OPTS, it
> would only take effect if Maven spawns a child process. It will never
> effect the main Maven execution.
>
> Paul
>
> On Wed, Oct 7, 2009 at 11:24 AM, Ivalo <iv...@iki.fi> wrote:
>   
>> Even better is use files to put these MAVEN_OPTS definitions
>>
>> in Linux env : /etc/mavenrc or $HOME/.mavenrc file
>>
>> in Windows %HOMEDRIVE%%HOMEPATH%\mavenrc_pre.bat file which is usually
>> C:\Documents and Settings\<username>\mavenrc_pre.bat
>>
>> With this way each Maven user can configure exact values what they want for
>> their environment.
>>
>> Rgds,
>>
>> Markku
>>
>> Paul Benedict wrote:
>>     
>>> You could set it in your mvn.bat, right?
>>>
>>> On Wed, Oct 7, 2009 at 10:14 AM, NGUYEN Cong Kinh
>>> <co...@it-sudparis.eu> wrote:
>>>
>>>       
>>>> Hello everybody,
>>>>
>>>> Is there anyway to configure MAVEN_OPTS from the POM file (no variable)?
>>>> For
>>>> example, I want to configure Maven's memory is 768m. But I don't want to
>>>> add
>>>> the MAVEN_OPTS variable in the environment. This is possible to configure
>>>> my
>>>> POM? If yes, please send to me how to do this.
>>>>
>>>> Thanks in advance,
>>>> Kinh
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>>
>>>>         
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>   


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


Re: [Maven's memory] How to avoid adding the MAVEN_OPTS variable?

Posted by Paul Benedict <pb...@apache.org>.
Just so you guys know, if you use a Maven plugin to set MAVEN_OPTS, it
would only take effect if Maven spawns a child process. It will never
effect the main Maven execution.

Paul

On Wed, Oct 7, 2009 at 11:24 AM, Ivalo <iv...@iki.fi> wrote:
> Even better is use files to put these MAVEN_OPTS definitions
>
> in Linux env : /etc/mavenrc or $HOME/.mavenrc file
>
> in Windows %HOMEDRIVE%%HOMEPATH%\mavenrc_pre.bat file which is usually
> C:\Documents and Settings\<username>\mavenrc_pre.bat
>
> With this way each Maven user can configure exact values what they want for
> their environment.
>
> Rgds,
>
> Markku
>
> Paul Benedict wrote:
>>
>> You could set it in your mvn.bat, right?
>>
>> On Wed, Oct 7, 2009 at 10:14 AM, NGUYEN Cong Kinh
>> <co...@it-sudparis.eu> wrote:
>>
>>>
>>> Hello everybody,
>>>
>>> Is there anyway to configure MAVEN_OPTS from the POM file (no variable)?
>>> For
>>> example, I want to configure Maven's memory is 768m. But I don't want to
>>> add
>>> the MAVEN_OPTS variable in the environment. This is possible to configure
>>> my
>>> POM? If yes, please send to me how to do this.
>>>
>>> Thanks in advance,
>>> Kinh
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: [Maven's memory] How to avoid adding the MAVEN_OPTS variable?

Posted by Ivalo <iv...@iki.fi>.
Even better is use files to put these MAVEN_OPTS definitions

in Linux env : /etc/mavenrc or $HOME/.mavenrc file

in Windows %HOMEDRIVE%%HOMEPATH%\mavenrc_pre.bat file which is usually C:\Documents and Settings\<username>\mavenrc_pre.bat

With this way each Maven user can configure exact values what they want 
for their environment.

Rgds,

Markku

Paul Benedict wrote:
> You could set it in your mvn.bat, right?
>
> On Wed, Oct 7, 2009 at 10:14 AM, NGUYEN Cong Kinh
> <co...@it-sudparis.eu> wrote:
>   
>> Hello everybody,
>>
>> Is there anyway to configure MAVEN_OPTS from the POM file (no variable)? For
>> example, I want to configure Maven's memory is 768m. But I don't want to add
>> the MAVEN_OPTS variable in the environment. This is possible to configure my
>> POM? If yes, please send to me how to do this.
>>
>> Thanks in advance,
>> Kinh
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>   


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


Re: [Maven's memory] How to avoid adding the MAVEN_OPTS variable?

Posted by Paul Benedict <pb...@apache.org>.
You could set it in your mvn.bat, right?

On Wed, Oct 7, 2009 at 10:14 AM, NGUYEN Cong Kinh
<co...@it-sudparis.eu> wrote:
> Hello everybody,
>
> Is there anyway to configure MAVEN_OPTS from the POM file (no variable)? For
> example, I want to configure Maven's memory is 768m. But I don't want to add
> the MAVEN_OPTS variable in the environment. This is possible to configure my
> POM? If yes, please send to me how to do this.
>
> Thanks in advance,
> Kinh
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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