Some maven notes.

1. if you want to see the detailed error message on the console, instead of reading it from the surefire files, you can use the maven-surefire-plugin:

<plugin>              

  <groupId>org.apache.maven.plugins</groupId>              

  <artifactId>maven-surefire-plugin</artifactId>

    <version>2.6</version>              

  <configuration>                

    <useFile>false</useFile>              

  </configuration>            

</plugin>

 

Or, do the "mvn clean install -Dsurefire.useFile=false"

 

2.  To make a jar with all the dependencies, we can use the plugin maven-assembly-plugin:

 

    <build>

        <plugins>

            <plugin>

                <artifactId>maven-assembly-plugin</artifactId>

                <configuration>

                    <descriptorRefs>

                        <descriptorRef>jar-with-dependencies</descriptorRef>

                    </descriptorRefs>

                    <archive>

                        <manifest>

                            <addClasspath>true</addClasspath>

                        </manifest>

                    </archive>

                </configuration>

                <executions>

                    <execution>

                        <id>make-assembly</id>

                        <phase>package</phase>

                        <goals>

                            <goal>single</goal>

                        </goals>

                    </execution>

                </executions>

            </plugin>

        </plugins>

    </build>

posted @ 2010-09-10 14:28  Dikang Gu  阅读(151)  评论(0编辑  收藏  举报