2014-02-28 4 views
0

단일 pom.xml을 사용하여 maven에서 여러 CMD 명령을 실행하고 싶습니다.maven pom.xml 파일을 사용하여 cmd 명령을 실행하십시오.

나는이 플러그인을 사용하고 있지만 내가 어떻게 할 수 있습니다 알고있다 그는

<pluginManagement>   <plugins> 
       <plugin> 
        <!-- ignore unsupported maven operations in eclipse m2e --> 
        <groupId>org.eclipse.m2e</groupId> 
        <artifactId>lifecycle-mapping</artifactId> 
        <version>1.0.0</version> 
        <configuration> 
         <lifecycleMappingMetadata> 
          <pluginExecutions> 
           <pluginExecution> 
            <pluginExecutionFilter> 
             <groupId>org.apache.maven.plugins</groupId> 
             <artifactId>maven-dependency-plugin</artifactId> 
             <versionRange>[1.0.0,)</versionRange> 
             <goals> 
              <goal>unpack</goal> 
             </goals> 
            </pluginExecutionFilter> 
            <action> 
             <ignore /> 
            </action> 
           </pluginExecution> 
          </pluginExecutions> 
         </lifecycleMappingMetadata> 
        </configuration> 
       </plugin> 

       <plugin> 
        <groupId>org.codehaus.mojo</groupId> 
        <artifactId>exec-maven-plugin</artifactId> 
        <version>1.2</version> 
        <executions> 
        <execution> 
         <id>run a backup</id> 
         <phase>pre-integration-test</phase> 
         <goals> 
         <goal>exec</goal> 
         </goals> 
         <configuration> 
         <executable>yourscript.sh</executable> 
         </configuration> 
        </execution> 
        </executions> 
       </plugin> 

      </plugins>  </pluginManagement> 

작동하지 않습니다?

+0

뭔가를 시도? – Masudul

+0

'cd files123'및 '불평' –

+0

추가 작업과 Ant 작업을 보셨습니까? –

답변

0

가 실행할 명령을

<plugin> 
<artifactId>maven-antrun-plugin </artifactId> 
    <executions> 
    <execution> 
     <phase>install </phase> 
     <configuration> 
     <tasks name="Run Notepad">  
      <exec 
      dir="${basedir}" 
      executable="${basedir}/notepad.exe" 
      failonerror="true"> 
      <arg line=""/> 
      </exec> 
     </tasks> 
     </configuration> 
     <goals> 
     <goal>run </goal> 
     </goals> 
    </execution> 
    </executions> 
</plugin> 
관련 문제