maven deployment with ftp uploading: I want to upload just the war file but is uploading more files

StackOverflow https://stackoverflow.com/questions/15884708

문제

I am following instructions exactly as specified here:

http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ftp.html

(The only difference is that I'm using version 2.4 of wagon-ftp).

and then execute

mvn deploy

I just want to upload a single war file, however it uploads several other files, with pom, md5, sha1 extensions and buries them under one of my source directories.

I've been trying to look for the appropriate configuration to modify this behaviour with no luck yet.

도움이 되었습니까?

해결책 2

wagon-plugins are for deploying artifacts to repositories, repositories need all those other files to function. If you are trying to ftp your .war file to a server for deployment, then use the correct plugin for your server, not the wagon-plugin.

The documentation for that plug starts off with

In order to deploy artifacts using FTP ...

mvn deploy is for deploying artifacts to a repository, thus all the other files that are needed for the repository to function are uploaded as well.

다른 팁

Use Ant and it's FTP task in order to upload generated war file.

With antrun plugin you can execute your ant script like that:

 <plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-antrun-plugin</artifactId>
   <version>1.7</version>
   <configuration>
     <target>
        <property name="file_name" value="${project.build.finalName}.war" />
        <ant antfile="${basedir}/build.xml">
           <target name="war upload" />
        </ant>
     </target>
   </configuration>
 </plugin>

Use property in order to define some property like file name/path to ant script. All maven's properties are accessible in ant script too.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top