Maven2ã§ææç©ãFTPã使ã£ã¦ã¢ããããæ¹æ³
追è¨ï¼
Ant使ããªãã¦ãã§ãã¾ããã
Maven2で成果物をFTPを使ってアップする方法(Antを使わない版) - tanamonの日記
ãããªãå
¬å¼ãµã¤ãã®ãã©ã°ã¤ã³ä¸è¦§ã«ããã ããã¨æã£ã¦ãããç¡ãã£ãã
wagon-ftpã®ãããªãªãã¸ããªã«ç»é²ããæ¹æ³ã¨ãã¦FTPã使ããã¨ãããã®ã¯ãããã ãã©ãã
æ¢ãã¨Alakai FTP Pluginã¨ãããã®ããã£ã¦ãããã使ãã°ãã¡ã¤ã«ã®è»¢éã¯ã§ããã¿ããã
ãã ãããã¹ã¯ã¼ãã¯æ¯åæå
¥åããªãã¨ãããªãããã¨ã使ã£ã¦ãã人ãã»ã¨ãã©ããªãã
ã§ãåããããªäºããããã人ãªãã¦çµæ§ããæ°ãããã®ã«ã¿ããªã©ããã¦ãã®ããªãã¨æã£ã¦ãããã©ãããmaven-antrun-pluginã使ã£ã¦Antã®FTPã¿ã¹ã¯ã¨ãã¦å®è¡ããã¦ããã¿ããã
Antãæ¢ãã¦Maven2ã使ããã¨ãã¦ããã®ã«ãã¾ããå
é¨ã§Antã使ãç¾½ç®ã«ãªãã¨ã¯ããã
ã¨ãããã¨ã§ã以ä¸ãmaven-antrun-pluginã使ã£ã¦FTPã使ã£ã¦ã¢ããããæ¹æ³ã§ãã
pom.xml
<build> ... <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>ftp-upload</id> <phase>deploy</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> <ftp server="${ftp.server}" remotedir="${ftp.remotedir}" userid="${ftp.username}" password="${ftp.password}"> <fileset dir="${project.build.directory}"> <include name="${project.build.finalName}.${project.packaging}" /> </fileset> </ftp> </tasks> </configuration> </execution> </executions> <dependencies> <dependency> <groupId>ant</groupId> <artifactId>ant-commons-net</artifactId> <version>1.6.5</version> </dependency> <dependency> <groupId>commons-net</groupId> <artifactId>commons-net</artifactId> <version>1.4.1</version> </dependency> </dependencies> </plugin> </plugins> </build> <properties> <ftp.server>server.example.com</ftp.server> <ftp.username>user</ftp.username> <ftp.password>pass</ftp.password> <ftp.remotedir>/tmp/deploy</ftp.remotedir> </properties>
ã¡ãªã¿ã«ãä¾ã§ã¯FTPã®æ¥ç¶æ å ±ãpropertiesã«æ¸ãã¦ãã¾ãããããã ã¨ææç©ã®META-INFå ã®pom.xmlãè¦ãã¨ãã¹ã¯ã¼ãããã¬ãã¬ã«ãªãã®ã§ãå®éã«ã¯setting.xmlãããã«æ¸ããæ¹ãå®å ¨ã§ãã