zoukankan      html  css  js  c++  java
  • maven 三个基本插件 clean dependency compiler

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
    
      <groupId>com.zzz</groupId>
      <artifactId>zzzz-core</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>jar</packaging>
    
      <name>zzzz-core</name>
      <url>http://maven.apache.org</url>
    
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>
    
      <dependencies>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>3.8.1</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      
      <build>
      
          <outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory><!-- 这句必须写,否则没有编译后存放class的地方 -->
          <resources><!-- 如果java包里面还有一些xml文件也需要放入classes文件中 --><!--使用resources 方法导致xml 文件无法编辑,所以不建议使用,改用 maven resources插件,见下-->
              <resource>
                  <directory>src/main/java</directory>
                  <includes>
                      <include>**/*.xml</include>
                  </includes>
                  <filtering>true</filtering>
              </resource>
          </resources>
          <plugins>
          
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.1</version>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>src/main/webapp/WEB-INF/lib</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>src/main/webapp/WEB-INF/lib</directory>
                            <followSymlinks>false</followSymlinks>                        
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            
            
            <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>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
          
          
          
              <plugin>
                <groupId>org.mybatis.generator</groupId>
                <artifactId>mybatis-generator-maven-plugin</artifactId>
                <version>1.3.2</version>
                <configuration>
                    <configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
                    <verbose>true</verbose>
                    <overwrite>true</overwrite>
                </configuration>
                <executions>
                    <execution>
                        <id>Generate MyBatis Artifacts</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.mybatis.generator</groupId>
                        <artifactId>mybatis-generator-core</artifactId>
                        <version>1.3.2</version>
                    </dependency>
                    <dependency>
                    <groupId>mysql</groupId>
                        <artifactId>mysql-connector-java</artifactId>
                        <version>5.1.30</version>
                        <scope>runtime</scope>
                    </dependency>
                </dependencies>
            </plugin>
            
            
            
          </plugins>
      </build>
      
      
    </project>
    <plugin>
                  <artifactId>maven-resources-plugin</artifactId>
                  <version>2.5</version>
                  <executions>
                    <execution>
                      <id>copy-resources</id>
                      <phase>validate</phase>
                      <goals>
                        <goal>copy-resources</goal>
                     </goals>
                    <configuration>
                       <outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory>
                       <resources>          
                         <resource>
                           <directory>src/main/java</directory>
                        <includes>
                            <include>**/*.xml</include>
                        </includes>
                           <filtering>true</filtering>
                         </resource>
                       </resources>              
                     </configuration>            
                   </execution>
                 </executions>
               </plugin>
  • 相关阅读:
    EntityFramework4.5使用Expression类创建动态查询及动态查询导航属性
    EF 5.0 帮助类
    EF异常:“System.InvalidOperationException”类型的未经处理的异常在 mscorlib.dll 中发生
    EF框架学习手记
    Entity Framework 学习
    C#特性-表达式树
    LINQ to SQL 运行时动态构建查询条件
    一点css 基础
    JQuery 判断复选框是否选中
    Asp.Net Server.MapPath()用法
  • 原文地址:https://www.cnblogs.com/zhangchenglzhao/p/5724609.html
Copyright © 2011-2022 走看看