2011-02-14 6 views
0

정말 간단하게하려고합니다. Maven에서 Ant 태스크를 실행합니다. 실수, 맞지? 잘못된.Maven이 내 Ant 대상을 실행하지 않습니다.

<?xml version="1.0" encoding="UTF-8"?> 
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" 
     xmlns="http://maven.apache.org/POM/4.0.0" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 

    <modelVersion>4.0.0</modelVersion> 
    <parent> 
     <artifactId>sampleproject-app</artifactId> 
     <groupId>org.sampleproject</groupId> 
     <version>0.0.1-SNAPSHOT</version> 
    </parent> 

    <groupId>org.sampleproject</groupId> 
    <artifactId>patient-labs-module</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>swf</packaging> 
    <name>Sample Project Patient Labs Module</name> 

    <properties> 
     <flex.sdk.version>4.1.0.16248</flex.sdk.version> 
    </properties> 

    <dependencies> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>flex-framework</artifactId> 
      <version>${flex.sdk.version}</version> 
      <type>pom</type> 
      <exclusions> 
       <exclusion> 
        <groupId>com.adobe.flex.framework</groupId> 
        <artifactId>playerglobal</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flexunit</groupId> 
      <artifactId>flexunit</artifactId> 
      <version>4.0-rc-1</version> 
      <type>swc</type> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.adobe.flex.framework</groupId> 
      <artifactId>playerglobal</artifactId> 
      <version>${flex.sdk.version}</version> 
      <classifier>10.1</classifier> 
      <type>swc</type> 
     </dependency> 
    </dependencies> 

    <build> 
     <sourceDirectory>${basedir}/main/flex</sourceDirectory> 
     <testSourceDirectory>${basedir}/test/flex</testSourceDirectory> 

     <resources> 
      <resource> 
       <directory>${basedir}/main/resources</directory> 
      </resource> 
     </resources> 

     <testResources> 
      <testResource> 
       <directory>${basedir}/test/resources</directory> 
      </testResource> 
     </testResources> 

     <plugins> 
      <plugin> 
       <groupId>org.sonatype.flexmojos</groupId> 
       <artifactId>flexmojos-maven-plugin</artifactId> 
       <version>3.8</version> 
       <extensions>true</extensions> 
       <dependencies> 
        <dependency> 
         <groupId>com.adobe.flex</groupId> 
         <artifactId>compiler</artifactId> 
         <version>${flex.sdk.version}</version> 
         <type>pom</type> 
        </dependency> 
       </dependencies> 
       <configuration> 
        <sourceFile>application.mxml</sourceFile> 
        <targetPlayer>10.1</targetPlayer> 
       </configuration> 
      </plugin> 
      <plugin> 
       <artifactId>maven-antrun-plugin</artifactId> 
       <executions> 
        <execution> 
         <phase>install</phase> 
         <configuration> 
          <tasks> 
           <mkdir dir="/var/www/sampleproject/patientlabs"/> 
           <copy todir="/var/www/sampleproject/patientlabs"> 
            <fileset file="${project.build.directory}/${project.build.finalName}.${project.packaging}"/> 
            <fileset dir="main/resources" includes="**/*"/> 
           </copy> 
          </tasks> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 
</project> 

내가 잘못 뭐하는 거지 :

여기 내 치어입니까? mvn install을 실행하면 Ant 대상이 절대로 실행되지 않습니다. 이 작업을 수행하는 더 좋은 방법이 있습니까? 필자는 localhost HTTP 서버에서 테스트 할 수 있도록 리소스 디렉토리와 주 swf의 특정 파일을 로컬 디렉토리에 복사하기 만하면됩니다. 당신은 받는다는 - antrun - 플러그인의 usage 사이트를 보면

답변

2

당신은 목표는 당신이를 추가 할 수 있다고 가정 플러그인 구성

 <goals> 
      <goal>run</goal> 
     </goals> 

에 지정된 또한 볼 수 있습니다.

+0

감사합니다. 정말 제 메이븐 책을 읽어야합니다. :) –

관련 문제