You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by David Nemer <da...@gmail.com> on 2009/04/29 20:53:31 UTC

Building without Testing

Hello Everyone,

I'm running Maven through my Java code. It builds the POM.XML file. But it
also runs the test scripts. I was wondering if there is a way to skip the
test scripts.

This is my code:

request.setGoals(Collections.singletonList("install"));
Invoker invoker = new DefaultInvoker();
File mavenHome = new File(mavenHomePath);
invoker.setMavenHome(mavenHome);
InvocationResult result = null;
result = invoker.execute(request);


Thank you.
--
David Nemer
Sent from Kaiserslautern, RP, Germany

Re: Building without Testing

Posted by David Nemer <da...@gmail.com>.
Nervermind what I said before!!

Here is the solution:

Properties mavenProperty = new Properties();
mavenProperty.setProperty("maven.test.skip", "true");
InvocationRequest request = new DefaultInvocationRequest();
request.setProperties(mavenProperty);

Thank you all for the help!

Cheers,
--
David Nemer
Sent from Kaiserslautern, RP, Germany

On Thu, Apr 30, 2009 at 1:02 AM, David Nemer <da...@gmail.com> wrote:

> Hey all,
>
> as I was googling it, I found that the property is: maven.test.skip
> But how would I specify that in InvocationRequest.setProperty(Properties
> arg0);
>
> In other words, I need to make maven.test.skip a Property.
>
> Does anyone know it?
>
> --
> David Nemer
> Sent from Kaiserslautern, RP, Germany
>
> On Wed, Apr 29, 2009 at 9:02 PM, Nick Stolwijk <ni...@gmail.com>wrote:
>
>> Normally you would add a property "-DskipTests", I guess you have to
>> look at the setProperties of the InvocationRequest [1]
>>
>> [1]
>> http://maven.apache.org/shared/maven-invoker/apidocs/org/apache/maven/shared/invoker/InvocationRequest.html#setProperties(java.util.Properties)<http://maven.apache.org/shared/maven-invoker/apidocs/org/apache/maven/shared/invoker/InvocationRequest.html#setProperties%28java.util.Properties%29>
>>
>> Hth,
>>
>> Nick Stolwijk
>> ~Java Developer~
>>
>> Iprofs BV.
>> Claus Sluterweg 125
>> 2012 WS Haarlem
>> www.iprofs.nl
>>
>>
>>
>> On Wed, Apr 29, 2009 at 8:53 PM, David Nemer <da...@gmail.com>
>> wrote:
>> > request
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>

Re: Building without Testing

Posted by David Nemer <da...@gmail.com>.
Hey all,

as I was googling it, I found that the property is: maven.test.skip
But how would I specify that in InvocationRequest.setProperty(Properties
arg0);

In other words, I need to make maven.test.skip a Property.

Does anyone know it?

--
David Nemer
Sent from Kaiserslautern, RP, Germany

On Wed, Apr 29, 2009 at 9:02 PM, Nick Stolwijk <ni...@gmail.com>wrote:

> Normally you would add a property "-DskipTests", I guess you have to
> look at the setProperties of the InvocationRequest [1]
>
> [1]
> http://maven.apache.org/shared/maven-invoker/apidocs/org/apache/maven/shared/invoker/InvocationRequest.html#setProperties(java.util.Properties)<http://maven.apache.org/shared/maven-invoker/apidocs/org/apache/maven/shared/invoker/InvocationRequest.html#setProperties%28java.util.Properties%29>
>
> Hth,
>
> Nick Stolwijk
> ~Java Developer~
>
> Iprofs BV.
> Claus Sluterweg 125
> 2012 WS Haarlem
> www.iprofs.nl
>
>
>
> On Wed, Apr 29, 2009 at 8:53 PM, David Nemer <da...@gmail.com> wrote:
> > request
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Building without Testing

Posted by Nick Stolwijk <ni...@gmail.com>.
Normally you would add a property "-DskipTests", I guess you have to
look at the setProperties of the InvocationRequest [1]

[1] http://maven.apache.org/shared/maven-invoker/apidocs/org/apache/maven/shared/invoker/InvocationRequest.html#setProperties(java.util.Properties)

Hth,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl



On Wed, Apr 29, 2009 at 8:53 PM, David Nemer <da...@gmail.com> wrote:
> request

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


Re: Building without Testing

Posted by David Hoffer <dh...@gmail.com>.
Can you include the command line param -DskipTests=true

Dave
- sent via G1

On Apr 29, 2009 12:54 PM, "David Nemer" <da...@gmail.com> wrote:

Hello Everyone,

I'm running Maven through my Java code. It builds the POM.XML file. But it
also runs the test scripts. I was wondering if there is a way to skip the
test scripts.

This is my code:

request.setGoals(Collections.singletonList("install"));
Invoker invoker = new DefaultInvoker();
File mavenHome = new File(mavenHomePath);
invoker.setMavenHome(mavenHome);
InvocationResult result = null;
result = invoker.execute(request);


Thank you.
--
David Nemer
Sent from Kaiserslautern, RP, Germany