maven 打jar包

 	<groupId>com.cyyun</groupId>
	<artifactId>imgapp</artifactId>
	<version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    
    
	<name>imgapp</name>
	<url>http://maven.apache.org</url>
	
	 <properties>
		<junit4.0.version>4.0</junit4.0.version>
		<spring3.2.4.version>3.2.4.RELEASE</spring3.2.4.version>
		<servlet2.5.version>2.5</servlet2.5.version>
		<velocity1.7.version>1.7</velocity1.7.version>
		<tomcat.dbcp.version>7.0.42</tomcat.dbcp.version>
		<mybatis.version>3.2.0</mybatis.version>
		<mybatis.spring.version>1.2.0</mybatis.spring.version>
		<log4j.vesion>1.2.17</log4j.vesion>
		<postgresql.driver>9.1-901.jdbc4</postgresql.driver>
		<hsqldb.version>2.3.0</hsqldb.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<netbeans.hint.deploy.server>Tomcat</netbeans.hint.deploy.server>
	</properties>
	
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <optimize>true</optimize>
                    <encoding>${project.build.sourceEncoding}</encoding> 
                </configuration>
            </plugin>
            <plugin> 
                <groupId>org.apache.maven.plugins</groupId> 
                <artifactId>maven-resources-plugin</artifactId> 
                <version>2.4</version> 
                <configuration> 
                    <encoding>${project.build.sourceEncoding}</encoding> 
                </configuration> 
            </plugin> 
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version> 
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>lib/</classpathPrefix>
                            <mainClass>com.cyyun.imgapp.timer.MainScheduler</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin> 
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-dependency-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <skipTests>true</skipTests><!--是否跳过测试-->
                    <!--<classesDirectory>${project.build.directory}/generated-classes/emma/classes</classesDirectory>To generate test coverage report-->
                </configuration>
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>install</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>
                                ${project.build.directory}/lib
                            </outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
          <plugin>      	<groupId>org.apache.maven.plugins</groupId>      	<artifactId>maven-surefire-plugin</artifactId>      	<version>2.6</version>		<configuration>			<skipTests>true</skipTests>		</configuration>      </plugin>
        </plugins>
    </build>

 

   有时候会出现这种异常,

    Failed to execute goal org.apache.maven.plugins maven-compiler-plugin:2.3.2:

   解决,讲引用的jre换为jdk目录

 

 

 

你可能感兴趣的:(maven 打jar包)