You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by Shaojun Zhao <sh...@gmail.com> on 2011/05/07 07:42:45 UTC

mvn install taking too long

I have to frequently make changes in
/mahout/mahout-distribution-0.4/core/src/main/java/org/apache/mahout/classifier/bayes/TestClassifier.java

So I run
> mvn compile
> mvn install

Compile takes a few secondes, but the install takes 8 minitues, which
is too long!

Is there any way that I can run mahout without "mvn install". RIght
now, if I only run "mvn compile", but do not run "mvn install", and
when I run things like mahout testclassifier is still the old one.
"mvn install" does the job well, but taking way too long!

Thanks a lot in advance!
-Sam

Re: mvn install taking too long

Posted by Shaojun Zhao <zh...@gmail.com>.
Thanks! Now it is 12 seconds. -Sam

On Sat, May 7, 2011 at 12:31 AM, Ted Dunning <te...@gmail.com> wrote:
> Try
>
> mvn -DskipTests install
>
> On Fri, May 6, 2011 at 10:42 PM, Shaojun Zhao <sh...@gmail.com> wrote:
>
>> I have to frequently make changes in
>>
>> /mahout/mahout-distribution-0.4/core/src/main/java/org/apache/mahout/classifier/bayes/TestClassifier.java
>>
>> So I run
>> > mvn compile
>> > mvn install
>>
>> Compile takes a few secondes, but the install takes 8 minitues, which
>> is too long!
>>
>> Is there any way that I can run mahout without "mvn install". RIght
>> now, if I only run "mvn compile", but do not run "mvn install", and
>> when I run things like mahout testclassifier is still the old one.
>> "mvn install" does the job well, but taking way too long!
>>
>> Thanks a lot in advance!
>> -Sam
>>
>

Re: mvn install taking too long

Posted by Lance Norskog <go...@gmail.com>.
mvn -Dtest=ClassNameWithoutPath install will do one test.

On Sat, May 7, 2011 at 7:26 AM, Shaojun Zhao <zh...@gmail.com> wrote:
> Thanks, that helps a lot!
>
> Just for your information, TestClassifier.java is not a testing class.
> I know, the file name is a little bit confusing. It is a class that
> predict categories using the learned model in TrainClassifier.java.
>
> Best regards,
> -Sam
>
>
> On Sat, May 7, 2011 at 5:33 AM, Dhruv <dh...@gmail.com> wrote:
>> On Sat, May 7, 2011 at 3:31 AM, Ted Dunning <te...@gmail.com> wrote:
>>
>>> Try
>>>
>>> mvn -DskipTests install
>>>
>>> On Fri, May 6, 2011 at 10:42 PM, Shaojun Zhao <sh...@gmail.com> wrote:
>>>
>>> > I have to frequently make changes in
>>> >
>>> >
>>> /mahout/mahout-distribution-0.4/core/src/main/java/org/apache/mahout/classifier/bayes/TestClassifier.java
>>> >
>>> > So I run
>>> > > mvn compile
>>> > > mvn install
>>> >
>>> > Compile takes a few secondes, but the install takes 8 minitues, which
>>> > is too long!
>>> >
>>> > Is there any way that I can run mahout without "mvn install". RIght
>>> > now, if I only run "mvn compile", but do not run "mvn install", and
>>> > when I run things like mahout testclassifier is still the old one.
>>> > "mvn install" does the job well, but taking way too long!
>>>
>>
>> Like Ted said you can skip testing while you are making changes to your
>> testing classes and run the entire suite of tests in the end.
>>
>> However, to quickly test only one test class, you can use the <includes>
>> tag.
>> To do this, modify the Surefire plugin's settings inside the top level
>> pom.xml ($MAHOUT_HOME/pom.xml)
>>
>> <plugins>
>>      <plugin>
>>        <groupId>org.apache.maven.plugins</groupId>
>>        <artifactId>maven-surefire-plugin</artifactId>
>>        <configuration>
>>          <forkMode>once</forkMode>
>>          <argLine>-Xms256m -Xmx512m</argLine>
>>          <testFailureIgnore>false</testFailureIgnore>
>>          <redirectTestOutputToFile>true</redirectTestOutputToFile>
>>          <includes>
>>            <include>**/TestClassifier.java</include>
>>          </includes>
>>        </configuration>
>>      </plugin>
>> .
>> .
>> .
>> </plugins>
>>
>>
>> Now, you can run:
>>
>> $ mvn clean install
>>
>> This should automatically clean, re compile, and only run the tests of
>> "TestClassifier.java".
>>
>> In the end the command will also install the binaries for you. Note that you
>> don't need to type mvn compile separately because the compile target comes
>> before install in the lifecycle of mvn install.
>>
>>
>>
>>>
>>> > Thanks a lot in advance!
>>> > -Sam
>>> >
>>>
>>
>



-- 
Lance Norskog
goksron@gmail.com

Re: mvn install taking too long

Posted by Shaojun Zhao <zh...@gmail.com>.
Thanks, that helps a lot!

Just for your information, TestClassifier.java is not a testing class.
I know, the file name is a little bit confusing. It is a class that
predict categories using the learned model in TrainClassifier.java.

Best regards,
-Sam


On Sat, May 7, 2011 at 5:33 AM, Dhruv <dh...@gmail.com> wrote:
> On Sat, May 7, 2011 at 3:31 AM, Ted Dunning <te...@gmail.com> wrote:
>
>> Try
>>
>> mvn -DskipTests install
>>
>> On Fri, May 6, 2011 at 10:42 PM, Shaojun Zhao <sh...@gmail.com> wrote:
>>
>> > I have to frequently make changes in
>> >
>> >
>> /mahout/mahout-distribution-0.4/core/src/main/java/org/apache/mahout/classifier/bayes/TestClassifier.java
>> >
>> > So I run
>> > > mvn compile
>> > > mvn install
>> >
>> > Compile takes a few secondes, but the install takes 8 minitues, which
>> > is too long!
>> >
>> > Is there any way that I can run mahout without "mvn install". RIght
>> > now, if I only run "mvn compile", but do not run "mvn install", and
>> > when I run things like mahout testclassifier is still the old one.
>> > "mvn install" does the job well, but taking way too long!
>>
>
> Like Ted said you can skip testing while you are making changes to your
> testing classes and run the entire suite of tests in the end.
>
> However, to quickly test only one test class, you can use the <includes>
> tag.
> To do this, modify the Surefire plugin's settings inside the top level
> pom.xml ($MAHOUT_HOME/pom.xml)
>
> <plugins>
>      <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-surefire-plugin</artifactId>
>        <configuration>
>          <forkMode>once</forkMode>
>          <argLine>-Xms256m -Xmx512m</argLine>
>          <testFailureIgnore>false</testFailureIgnore>
>          <redirectTestOutputToFile>true</redirectTestOutputToFile>
>          <includes>
>            <include>**/TestClassifier.java</include>
>          </includes>
>        </configuration>
>      </plugin>
> .
> .
> .
> </plugins>
>
>
> Now, you can run:
>
> $ mvn clean install
>
> This should automatically clean, re compile, and only run the tests of
> "TestClassifier.java".
>
> In the end the command will also install the binaries for you. Note that you
> don't need to type mvn compile separately because the compile target comes
> before install in the lifecycle of mvn install.
>
>
>
>>
>> > Thanks a lot in advance!
>> > -Sam
>> >
>>
>

Re: mvn install taking too long

Posted by Dhruv <dh...@gmail.com>.
On Sat, May 7, 2011 at 3:31 AM, Ted Dunning <te...@gmail.com> wrote:

> Try
>
> mvn -DskipTests install
>
> On Fri, May 6, 2011 at 10:42 PM, Shaojun Zhao <sh...@gmail.com> wrote:
>
> > I have to frequently make changes in
> >
> >
> /mahout/mahout-distribution-0.4/core/src/main/java/org/apache/mahout/classifier/bayes/TestClassifier.java
> >
> > So I run
> > > mvn compile
> > > mvn install
> >
> > Compile takes a few secondes, but the install takes 8 minitues, which
> > is too long!
> >
> > Is there any way that I can run mahout without "mvn install". RIght
> > now, if I only run "mvn compile", but do not run "mvn install", and
> > when I run things like mahout testclassifier is still the old one.
> > "mvn install" does the job well, but taking way too long!
>

Like Ted said you can skip testing while you are making changes to your
testing classes and run the entire suite of tests in the end.

However, to quickly test only one test class, you can use the <includes>
tag.
To do this, modify the Surefire plugin's settings inside the top level
pom.xml ($MAHOUT_HOME/pom.xml)

<plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <forkMode>once</forkMode>
          <argLine>-Xms256m -Xmx512m</argLine>
          <testFailureIgnore>false</testFailureIgnore>
          <redirectTestOutputToFile>true</redirectTestOutputToFile>
          <includes>
            <include>**/TestClassifier.java</include>
          </includes>
        </configuration>
      </plugin>
.
.
.
</plugins>


Now, you can run:

$ mvn clean install

This should automatically clean, re compile, and only run the tests of
"TestClassifier.java".

In the end the command will also install the binaries for you. Note that you
don't need to type mvn compile separately because the compile target comes
before install in the lifecycle of mvn install.



>
> > Thanks a lot in advance!
> > -Sam
> >
>

Re: mvn install taking too long

Posted by Ted Dunning <te...@gmail.com>.
Try

mvn -DskipTests install

On Fri, May 6, 2011 at 10:42 PM, Shaojun Zhao <sh...@gmail.com> wrote:

> I have to frequently make changes in
>
> /mahout/mahout-distribution-0.4/core/src/main/java/org/apache/mahout/classifier/bayes/TestClassifier.java
>
> So I run
> > mvn compile
> > mvn install
>
> Compile takes a few secondes, but the install takes 8 minitues, which
> is too long!
>
> Is there any way that I can run mahout without "mvn install". RIght
> now, if I only run "mvn compile", but do not run "mvn install", and
> when I run things like mahout testclassifier is still the old one.
> "mvn install" does the job well, but taking way too long!
>
> Thanks a lot in advance!
> -Sam
>