2013-05-31 9 views
5

Ich versuche, die .jar, erstellt von Maven 3, an einen anderen Ort zu kopieren. Momentan verwende ich Ant's Kopieraufgabe, aber Maven kopiert die Datei einfach nicht.Kopieren Sie eine JAR-Datei mit Maven

<plugin> 
    <artifactId>maven-antrun-plugin</artifactId> 
    <executions> 
    <execution> 
     <phase>install</phase> 
     <configuration> 
     <tasks> 
      <copy file="target/myfile.jar" tofile="D:/Bukkit/plugins/myfile.jar"/> 
     </tasks> 
     </configuration> 
    </execution> 
    </executions> 
</plugin> 
+0

Die Frage ist, warum tun Sie das tun? Denn das sieht aus, dass du außerhalb des aktuellen Projekts kopierst, was * nicht * die Absicht von Maven ist. Das sieht mehr wie ein Job für ein Bereitstellungstool aus, das Maven * nicht * ist. Ant Aufgabe ist eine Möglichkeit, aber besser außerhalb von Maven gelöst. – khmarbaise

+0

Welches Werkzeug würden Sie für diesen Zweck vorschlagen? – kazanaki

Antwort

5
 <plugin> 
      <artifactId>maven-antrun-plugin</artifactId> 
      <configuration> 
       <tasks> 
        <copy file="target/myfile.jar" tofile="D:/Bukkit/plugins/myfile.jar"/> 
       </tasks> 
      </configuration> 
      <executions> 
       <execution> 
        <phase>install</phase> 
        <goals> 
         <goal>run</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin>