You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by shrimpywu <im...@gmail.com> on 2009/05/07 07:39:26 UTC

hi, how to specify java_opts in maven

Before i run my program like this

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
                <
                <configuration>
                    <executable>java</executable>
                    <arguments>
                        <argument>-Xms32m</argument>
                        <argument>-Xmx1024m</argument>
                        <argument>-classpath</argument>
                        <classpath />
                        <argument>org.myproject.Main</argument>
                    </arguments>
                </configuration>
                
            </plugin>

however i have to pass arguments in run time,
so i have to do things like this
 mvn exec:java -Dexec.mainClass="org.myproject.Main" -Dexec.args="argument1"

but i found out that, if i do in comand line, i can specify any argument in
the POM any more,
coz it will complain and throws exception.
but i do want to increase the java heap size, otherwise i will get "Out of
memory" exception

So...can any one help me how can i do both???
-- 
View this message in context: http://www.nabble.com/hi%2C-how-to-specify-java_opts-in-maven-tp23420573p23420573.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: hi, how to specify java_opts in maven

Posted by Brian Fox <br...@infinity.nu>.
I said below to set MAVEN_OPTS in your environment ;-)

On Fri, May 8, 2009 at 1:46 AM, shrimpywu <im...@gmail.com> wrote:

>
> so what should i do???
>
>
>
> BRIAN FOX-5 wrote:
> >
> > set MAVEN_OPTS = -Xmx512m for example. It can't be done directly from the
> > cli.
> >
> > On Thu, May 7, 2009 at 1:39 AM, shrimpywu <im...@gmail.com> wrote:
> >
> >>
> >> Before i run my program like this
> >>
> >> <plugin>
> >>                <groupId>org.codehaus.mojo</groupId>
> >>                <artifactId>exec-maven-plugin</artifactId>
> >>                <executions>
> >>                    <execution>
> >>                        <goals>
> >>                            <goal>exec</goal>
> >>                        </goals>
> >>                    </execution>
> >>                </executions>
> >>                <
> >>                <configuration>
> >>                    <executable>java</executable>
> >>                    <arguments>
> >>                        <argument>-Xms32m</argument>
> >>                        <argument>-Xmx1024m</argument>
> >>                        <argument>-classpath</argument>
> >>                        <classpath />
> >>                        <argument>org.myproject.Main</argument>
> >>                    </arguments>
> >>                </configuration>
> >>
> >>            </plugin>
> >>
> >> however i have to pass arguments in run time,
> >> so i have to do things like this
> >>  mvn exec:java -Dexec.mainClass="org.myproject.Main"
> >> -Dexec.args="argument1"
> >>
> >> but i found out that, if i do in comand line, i can specify any argument
> >> in
> >> the POM any more,
> >> coz it will complain and throws exception.
> >> but i do want to increase the java heap size, otherwise i will get "Out
> >> of
> >> memory" exception
> >>
> >> So...can any one help me how can i do both???
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/hi%2C-how-to-specify-java_opts-in-maven-tp23420573p23420573.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
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/hi%2C-how-to-specify-java_opts-in-maven-tp23420573p23440459.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: hi, how to specify java_opts in maven

Posted by shrimpywu <im...@gmail.com>.
so what should i do???



BRIAN FOX-5 wrote:
> 
> set MAVEN_OPTS = -Xmx512m for example. It can't be done directly from the
> cli.
> 
> On Thu, May 7, 2009 at 1:39 AM, shrimpywu <im...@gmail.com> wrote:
> 
>>
>> Before i run my program like this
>>
>> <plugin>
>>                <groupId>org.codehaus.mojo</groupId>
>>                <artifactId>exec-maven-plugin</artifactId>
>>                <executions>
>>                    <execution>
>>                        <goals>
>>                            <goal>exec</goal>
>>                        </goals>
>>                    </execution>
>>                </executions>
>>                <
>>                <configuration>
>>                    <executable>java</executable>
>>                    <arguments>
>>                        <argument>-Xms32m</argument>
>>                        <argument>-Xmx1024m</argument>
>>                        <argument>-classpath</argument>
>>                        <classpath />
>>                        <argument>org.myproject.Main</argument>
>>                    </arguments>
>>                </configuration>
>>
>>            </plugin>
>>
>> however i have to pass arguments in run time,
>> so i have to do things like this
>>  mvn exec:java -Dexec.mainClass="org.myproject.Main"
>> -Dexec.args="argument1"
>>
>> but i found out that, if i do in comand line, i can specify any argument
>> in
>> the POM any more,
>> coz it will complain and throws exception.
>> but i do want to increase the java heap size, otherwise i will get "Out
>> of
>> memory" exception
>>
>> So...can any one help me how can i do both???
>> --
>> View this message in context:
>> http://www.nabble.com/hi%2C-how-to-specify-java_opts-in-maven-tp23420573p23420573.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
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/hi%2C-how-to-specify-java_opts-in-maven-tp23420573p23440459.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: hi, how to specify java_opts in maven

Posted by Brian Fox <br...@infinity.nu>.
set MAVEN_OPTS = -Xmx512m for example. It can't be done directly from the
cli.

On Thu, May 7, 2009 at 1:39 AM, shrimpywu <im...@gmail.com> wrote:

>
> Before i run my program like this
>
> <plugin>
>                <groupId>org.codehaus.mojo</groupId>
>                <artifactId>exec-maven-plugin</artifactId>
>                <executions>
>                    <execution>
>                        <goals>
>                            <goal>exec</goal>
>                        </goals>
>                    </execution>
>                </executions>
>                <
>                <configuration>
>                    <executable>java</executable>
>                    <arguments>
>                        <argument>-Xms32m</argument>
>                        <argument>-Xmx1024m</argument>
>                        <argument>-classpath</argument>
>                        <classpath />
>                        <argument>org.myproject.Main</argument>
>                    </arguments>
>                </configuration>
>
>            </plugin>
>
> however i have to pass arguments in run time,
> so i have to do things like this
>  mvn exec:java -Dexec.mainClass="org.myproject.Main"
> -Dexec.args="argument1"
>
> but i found out that, if i do in comand line, i can specify any argument in
> the POM any more,
> coz it will complain and throws exception.
> but i do want to increase the java heap size, otherwise i will get "Out of
> memory" exception
>
> So...can any one help me how can i do both???
> --
> View this message in context:
> http://www.nabble.com/hi%2C-how-to-specify-java_opts-in-maven-tp23420573p23420573.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
>
>