zoukankan      html  css  js  c++  java
  • Maven copy方式列举

    maven copy有很多种方法:

    1.maven-antrun-plugin (使用ant复制)

     <build>
            <finalName>flex</finalName>
            <sourceDirectory>src</sourceDirectory>
            <outputDirectory>../monitorweb/src/main/webapp/topoview</outputDirectory>
            <plugins>
        
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.7</version>
                    <executions>
                         <execution>
                             <phase>validate</phase>
                             <goals>
                                 <goal>run</goal>
                             </goals>
                             <configuration>
                                 <tasks>
                                     <echo message="*****copy LocalConnectionSender.html and LocalConnectionSender.swf to  ../monitorweb/src/main/webapp/topoview*****"/>
                                     <copy todir="../monitorweb/src/main/webapp/topoview" overwrite="true">
                                     <fileset dir="src/assets/dragapp"/>
                                     </copy>
                                 </tasks>
                             </configuration>
                         </execution>
                        </executions>
                </plugin>
            </plugins>
    
        </build>

    2.maven-dependency-plugin

     <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>copy-installed</id>
                <phase>install</phase>
                <goals>
                  <goal>copy</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>${project.groupId}</groupId>
                      <artifactId>${project.artifactId}</artifactId>
                      <version>${project.version}</version>
                      <type>${project.packaging}</type>
                    </artifactItem>
                  </artifactItems>
                  <outputDirectory>some-other-place</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>

    3.maven-jar-plugin

        <project>
          ...
          <build>
            <plugins>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                ...
                <configuration>
                  <archive>
                    <manifest>
                      <addClasspath>true</addClasspath>
                    </manifest>
                  </archive>
                </configuration>
                ...
              </plugin>
            </plugins>
          </build>
          ...
          <dependencies>
            <dependency>
              <groupId>commons-lang</groupId>
              <artifactId>commons-lang</artifactId>
              <version>2.1</version>
            </dependency>
            <dependency>
              <groupId>org.codehaus.plexus</groupId>
              <artifactId>plexus-utils</artifactId>
              <version>1.1</version>
            </dependency>
          </dependencies>
          ...
        </project>

    最后我使用了maven ant ,感觉它控制的比较细,上手也比较快。

  • 相关阅读:
    python编码基础知识
    python编码问题
    python中文乱码
    mysql sql灵活运用
    MySQL函数讲解(MySQL函数大全)
    python:UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xef in position xxx: ordinal not in range(128)
    sql replace into 与 insert into
    微信布局
    盘点六大在中国复制失败的O2O案例
    字符串问题(一)
  • 原文地址:https://www.cnblogs.com/yangpigao/p/3156366.html
Copyright © 2011-2022 走看看