ã¯ããã«
ãããžã§ã¯ããæé·ããå€ãã®ã¢ãžã¥ãŒã«ãšäŸåé¢ä¿ãååŸãããšããããžã§ã¯ãã¢ã»ã³ããªãæåã§ã»ããã¢ããããã®ãéåžžã«é£ãããªãå ŽåããããŸãã ããã«ãéçºè ããã¹ã¿ãŒãã管çè ãŸã§ããããžã§ã¯ãã®ãã¹ãŠã®æè¡çãªåå è ãæ§æã«é¢äžãããããæéã®ç¡é§ã§ãã
ããã«ãéçºããã³ãã¹ãã·ã¹ãã ã絶ããæŽæ°ããå¿ èŠããããæ··ä¹±ããããšãããããŸããã ããã«ã¯ã ç¶ç¶çãªçµ±åã®å®è·µããªãããã§ã¯ãããŸããã
ãã®èšäºã§ã¯ãMavenã䜿çšããŠã¢ã»ã³ããªãå®è£ ããçµéšã«ã€ããŠèª¬æããŠãããããMavenã®åºæ¬çãªç¥èãå¿ èŠã§ãã ã¯ã€ãã¯ã¹ã¿ãŒãã®ããã«ããµã€ãã®http://www.apache-maven.ruãå匷ããã ãã§ååã§ãããããã¯ã®ãã詳现ãªéçºã«ã€ããŠã¯ãå ã®ãœãŒã¹http://maven.apache.orgãåç §ããŠãã ããã
ãã®èšäºã®ç®çã¯ãMavenã®äœ¿çšæ¹æ³ãæããããšã§ã¯ãªããããžãã£ããªãœãªã¥ãŒã·ã§ã³ãšãã¬ãã£ããªãœãªã¥ãŒã·ã§ã³ã䜿çšããå®è£ ã®çµéšã瀺ãããšã§ãã ãã®ç¥èãããã°ãããŒã ã«Mavenã¢ã»ã³ããªãç°¡åãã€è¿ éã«å±éã§ããŸãã
ãªãã¢ãªã§ã¯ãªãã®ã§ããïŒ
ãã®ãããªè³ªåãäºæ³ããŠãç§ãã¡ã¯antã䜿çšãããšèšããŸãããã¢ã»ã³ããªèªäœã§ã¯ãªããæè¡çãªæ©èœã®ããã«ä»¥äžã§è©³ãã説æããŸãã
Mavenã®ãã1ã€ã®éèŠãªå©ç¹ã¯ã䜿çšããã³ãŒãã®ã¿ãåéã§ããããšã§ããä»ã®ãã¹ãŠã¯å€éã«å¥ã®ãµãŒããŒã§åéãããŸãã
ç°å¢
ãŸãããããžã§ã¯ãã®æ§é ãšéçºã¢ãããŒãã«ã€ããŠã話ããã䟡å€ããããŸãã ãã®ãããžã§ã¯ãã¯é·å¹Žã«ããã£ãŠéçºãããŠããŠããã maven-webapp-artifactã«å¯Ÿå¿ããªãæ§é ãæã£ãŠãããããããã¯éåžžã«éèŠã§ãã
ãããã£ãŠã1ã€ã®SVNãªããžããªã«å€ãã®ã¢ãžã¥ãŒã«ãä¿åãããŠããŸãã åã¢ãžã¥ãŒã«ã«ã¯ãã¡ã€ã³ã®éçºãã©ã³ãïŒãã©ã³ã¯ïŒãšãå¿ èŠã«å¿ããŠã¿ã°ïŒã¿ã°ïŒããã³ãã©ã³ãïŒãã©ã³ãïŒããããŸãã ã»ãšãã©ã®ã¢ãžã¥ãŒã«ã«ã¯ãjavaã¯ã©ã¹ãšjspããŒãžãã¹ã¯ãªãããã°ã©ãã£ãã¯ã¹ãªã©ã®äž¡æ¹ãå«ãŸããŠããŸããã»ãšãã©ã®ã¢ãžã¥ãŒã«ã¯ã¹ã¿ã³ãã¢ãã³ã®Webã¢ããªã±ãŒã·ã§ã³ã§ãããç¬ç«ããŠåäœã§ããŸãã ã¢ãžã¥ãŒã«ã®äŸïŒã³ã¢ãç³é¹žãã¯ãŒã¯ãããŒãã¢ããªã³ãå ±é...ç§ã¯ãããã®çŽ100ãæ°ããŸããã
ã»ãšãã©ã®å Žåããããžã§ã¯ãã¯åå¥ã®ã¢ãžã¥ãŒã«ã§æ§æãããJavaã¯ã©ã¹ã®ç¹å®ã®ãªãœãŒã¹ãšããžãã¯ããã¹ãããŸãã æã«ã¯ããã®ãããªã¢ãžã¥ãŒã«ããããŸããã ãããžã§ã¯ãã®æçµçãªã¢ã»ã³ããªã¯ãåäžã®Webã¢ããªã±ãŒã·ã§ã³ã®åœ¢åŒã®äžé£ã®ã¢ãžã¥ãŒã«ã§æ§æãããŸãã
ã¢ãžã¥ãŒã«ã«å¿ èŠãªã©ã€ãã©ãªã¯ããªããžããªã®libãã©ã«ããŒã«çŽæ¥ä¿åãããŸããWebãªãœãŒã¹ã«ã¯ãç¬èªã®sx-warãã©ã«ããŒããããŸãã æšæºã®srcããã³testãã©ã«ããŒãšåæ§ã«ã
å¿ ç¶çã«ãã»ãšãã©ãã¹ãŠã®ã¢ãžã¥ãŒã«ã¯ã³ã¢ã«äŸåããå¿ èŠã«å¿ããŠçžäºã«äŸåããŸãã
ã¡ã¿æ å ±ãå«ãããŒã¿ããŒã¹ããããŸãã ããã«åºã¥ããŠãã¢ãžã¥ãŒã«ãçžäºäœçšãããŠãŒã¶ãŒãšã®ãã¹ãŠã®äœæ¥ãæ§ç¯ãããŸãã ããšãã°ãå ¬éãããã¯ãã¡ã¿æ å ±ã®åäœã§ãããããŒã¿ããŒã¹ã«ä¿åãããŸãã ã€ãŸããããŒã¿èªäœã«å ããŠãããŒã¿ããŒã¹ã«ã¯ãã®ããŒã¿ãæäœããããã®èšå®ãä¿åãããŸãã ãããã¯ã³ã³ãœãŒã«ã§ãæ§æãããŸããã³ã³ãœãŒã«ã¯ãå ¬éãŠãããã«ãåºã¥ããŠããŸãã ãµãŒãã¹ããã¯ã䜿çšããŠã¡ã¿æ å ±ã転éããããšãå¯èœã§ãã
çæ³çã«ã¯ãåã¢ãžã¥ãŒã«ã«ã¯ã¡ã¿æ å ±ãæã€ç¬èªã®å ±éããã±ãŒãžããããŸãã ã³ã¢ã®ããŒã¿ããŒã¹ã¯æ軜éã®ããŒã¿ããŒã¹ã§ãããã©ã®ã¢ãžã¥ãŒã«ã§ãæ¡åŒµã§ããŸãã ã«ãŒãã«ã¯ã»ãšãã©ã¢ããªã±ãŒã·ã§ã³ãµãŒããŒã§ãããå€æ©èœã¢ãžã¥ãŒã«ãåçã«ããŒã/ã¢ã³ããŒãããæ©èœã¯ãããŸããã ãã¹ãŠã®ã¢ãžã¥ãŒã«ã«åå¥ã®ã¡ã¿ãããããã§ã¯ãããŸãããããã®ããã«åªåããŠããŸã:)
BC
ãã®ãããªãã¬ãŒãºããããŸãã ã€ãŸããããããã¯ãäŒç€Ÿã§ã®äœæ¥ãéå§ãããåã§ãã£ãŠããããªãåã®ããšã§ããã ã¢ã»ã³ããªã®ã»ããã¢ãããã©ã®ããã«é²ãã ãã説æããŸãã ãŸããåããŠã®ã»ããã¢ããã«å€ãã®æéãè²»ããå¿ èŠããããŸããã
ãããŠãããªãã¯ç§ãã¡ãšäžç·ã«ä»äºãåŸãŸããã äºæ¥ç®ããããŸãã æåã®ãµãã·ã¹ãã ã¯ããµãã·ã¹ãã ã®ã¹ã¯ãªãŒã³ãã£ã¹ãã衚瀺ããã¡ã¿æ å ±ãæäœããŸããã ã¢ã»ã³ããªãæ§æããå¿ èŠããããŸãã ããŠããããžã§ã¯ãã®ãã¬ããžããŒã¹ã«ãããžã§ã¯ãã«å¿ èŠãªã¢ãžã¥ãŒã«ã«é¢ããæ å ±ãå«ãŸããŠããå Žåã å€ãã®å Žåããã®æ å ±ã¯é¢ä¿ãããŸããïŒæŽæ°ãå¿ããããã±ãŒã¹ããšã«æŽæ°ãããããïŒã ã¢ãžã¥ãŒã«èªäœã®äŸåé¢ä¿ã«é¢ããæ å ±ã¯èŠã€ãããŸããããã®æ å ±ãæ代é ãã«ãªã£ãŠããŸãã
å¿ èŠãªãã¹ãŠã®ã¢ãžã¥ãŒã«ã®ãã©ã³ã¯ããŒãžã§ã³ãSVNããæœåºãããIDEã§ãããžã§ã¯ããäœæãããŸãã ãããŠæãé£ããéšåïŒå¿ èŠãªãã¹ãŠã®ã©ã€ãã©ãªãšã¢ãžã¥ãŒã«æ¥ç¶ã®ã€ã³ããŒããæ§æããŸãã äžéšã®ã¢ãžã¥ãŒã«ããã©ã€ãã©ãªã®äžéšã®ããŒãžã§ã³ãé€å€ããä»ã®ã¢ãžã¥ãŒã«ã䜿çšããå¿ èŠãããå Žåã¯ãäŸç¶ãšããŠè€éã§ãã 1ã€ã®ãã©ã«ããŒå ã®ãã¹ãŠã®ã¢ãžã¥ãŒã«ã®ã¢ã»ã³ããªãæ§æããŸãã 次ã«ãWebã¢ããªã±ãŒã·ã§ã³ãµãŒããŒãæ§æããŸãïŒtomcatã䜿çšïŒã
ããã§ãããžã§ã¯ããæ§æãããŸããã次ã«ãæåã®ããŒãžã§ã³ã®2çªç®ã3çªç®ã®ããŒãžã§ã³ãæ§æããå¿ èŠããããŸãïŒãšã©ãŒãåŠçããã«ã¯ãã©ã³ãã䜿çšããŸãïŒã éçºè ã¯äžå®ã«ãªããŸãã
äŸåé¢ä¿ãå€æŽããããã¹ãŠã®ã¢ã»ã³ããªãå£ããŠããŸãã ãŸãã管çè ã¯antã䜿çšããŠè£œåã¢ã»ã³ããªãäœæããŸãããã¹ãŠãæ éããŸãã å€ãã®å Žåã管çè ãšéçºè ã®éã®ç°ãªãã¢ã»ã³ããªã«èµ·å ããåé¡ããããŸãã
æåã®è©Šã¿
éäŒãæ åœããç¹å¥ãªäººãããªãã£ãããmavenã«ã€ããŠã®ç¥èããªãã£ãã ãããã£ãŠããããžã§ã¯ãã«Mavenãå®è£ ããæåã®è©Šã¿ã¯å€±æããŸããã
芪pom.xmlã¯å¥ã®ãªããžããªãã©ã«ããŒã«é 眮ãããŠããŸãã ãã®åŸãå¥ã®ãããžã§ã¯ããã©ã«ããŒã§ã svn-externalsãæ§æããããããžã§ã¯ãã«å¿ èŠãªãã¹ãŠã®ã¢ãžã¥ãŒã«ãšãå¥ã®ãã©ã«ããŒã®èŠªpom.xmlãå«ãŸããŸããã
åäžã®SVNæ§é ã§ã¢ãžã¥ãŒã«ã®éå±€ã䜿çšããåŸæ¥ã®ã¢ãããŒãã¯ãåã¢ãžã¥ãŒã«ãå€æ°ã®ãããžã§ã¯ãã§äœ¿çšããããããç§ãã¡ã«ã¯é©ããŠããŸããã§ããã ãããŠã1ã€ã®ã·ã³ã°ã«ã ãã§ã¯ãããŸããã ãŸãããããžã§ã¯ãã§èŠªPOMãæäœããããšã¯æãŸãããããŸããã ããã«ãã¢ãžã¥ãŒã«ã®ããŒãžã§ã³ãä¿®æ£ãããšããã¹ãŠã®ãããžã§ã¯ãã«èªåçã«åœ±é¿ããŸãã
å¿ èŠãªãã¹ãŠã®ã©ã€ãã©ãªã¯http://search.maven.orgã§æ€çŽ¢ãããŸããã§ãããå€ãã®ã©ã€ãã©ãªãããããããã¯ãã¹ãŠãªããžããªå ã«ååšããŸããïŒããŒãžã§ã³ã®ãªãã©ã€ãã©ãªã¯libãã©ã«ããŒã«æ ŒçŽãããŸããããšãã°axis.jarãjtds.jarãvelocity.jarïŒã ã¹ã¯ãªããã䜿çšããŠããã¹ãŠã®ã©ã€ãã©ãªãNexusã«ããŒãããŸããã GroupIdããã³ArtifactIdã¯ããã¹ã¯sxã<ã©ã€ãã©ãªå>ïŒsx.axisïŒã䜿çšããŠèšå®ãããŸããã
å žåçãªpom.xmlã¢ãžã¥ãŒã«ã¯æ¬¡ã®ããã«ãªããŸãã
ããŒã¹pom.xml
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <!-- --> <parent> <groupId>sx.config</groupId> <artifactId>project-settings</artifactId> <version>2.0.1</version> <relativePath>project-settings/pom.xml</relativePath> </parent> <!-- --> <groupId>sx.builds</groupId> <artifactId>wfBuilder</artifactId> <version>2.0.1</version> <packaging>pom</packaging> <!-- --> <pluginRepositories> <pluginRepository> <id>sx-repository</id> <url>http://v5-neptun/nexus/content/repositories/sx-repository</url> </pluginRepository> </pluginRepositories> <!-- --> <repositories> <repository> <id>sx-repository</id> <url>http://v5-neptun/nexus/content/repositories/sx-repository</url> </repository> </repositories> <!--URL SVN--> <scm> <connection>scm:svn:svn://svn-server/buildsMaven/trunk/workflowBuild</connection> </scm> <!----> <modules> <module>core</module> <module>workflow</module> </modules> </project>
åãããžã§ã¯ãã«ã€ããŠããã®äžã®ã¢ãžã¥ãŒã«ã®ãªã¹ããå€æŽããå¿ èŠãããããšãããããŸãã
ã¢ã»ã³ããªäžã«ãåã¢ãžã¥ãŒã«ã¯åå¥ã®æŠäºã§ã¢ã»ã³ãã«ããã maven-overlayã䜿çšããŠå ±éã®ãããã€ã«å±éãããŸããã
倱æã®çç±
svn-externalsã䜿çšããMavenã¢ãããŒãã®å©ç¹ãå®å šã«æã¡æ¶ããŸããã ãã®ããããã£ã§ã¯ãsvnãã©ã«ããŒã®ããããã£ãæåã§ç·šéããã«ããã¹ãŠã®ã¢ãžã¥ãŒã«ã®ã³ãŒããæ確ã«ä¿®æ£ããããšã¯ã§ããŸããã ããã¯ã10ã15åã®ã¢ãžã¥ãŒã«ãååšããç¹å®ã®ããŒãžã§ã³ã®ãããããªãªãŒã¹ããããšãã»ãŒäžå¯èœã«ãªããŸãã ãããŠãç§ã¯æ¬åœã«MavenãªãªãŒã¹ãã©ã°ã€ã³ã䜿çšãããã£ãã®ã§ãã
é·æ
- ãã¹ãŠããä»ãããã§èµ·ãã£ãŠããŸãã éçºè ã¯ãSNAPSHOTäŸåé¢ä¿ïŒã¡ã€ã³ã®éçºãã©ã³ãããã®ãã«ãïŒã®æŽæ°æéã«äŸåããŸããã
- éçºè ã¯è€æ°ã®ã¢ãžã¥ãŒã«ãäžåºŠã«å€æŽã§ããŸãïŒã¢ãžã¥ãŒã«ã®ã«ãã»ã«åã«éåããŠãããããçãããç¹ã§ãïŒã
- å¿ èŠãªã¢ãžã¥ãŒã«ã®ã»ããå šäœã衚瀺ãããŸãã
çæ
- ãã¹ãŠã®ã¢ãžã¥ãŒã«ã®å®å šãªçµã¿ç«ãŠã«ã¯æéãããããŸãã
- ã³ãŒãããŒãžã§ã³ãé©åã«ããã¯ã§ããŸããã
- ãã¹ãŠã®ã©ã€ãã©ãªã¯ãããªãã¯ãªããžããªããååŸãããããã§ã¯ãããŸãããæ°ããã©ã€ãã©ãªãè¿œå ããã®ã¯å¥ã®æé ã§ãã
- Jar-hellã¯ã誰ãããããªãã¯ãªããžããªã®ã©ã€ãã©ãªã䜿çšããããšã決å®ãããããæ¢ã«äŒæ¥ã®ãªããžããªã«ããå Žåã«å¯èœã§ãïŒäž¡æ¹ã®ããŒãžã§ã³ããŸãã¯3ã€ãå±éã«ãªããŸãïŒïŒã ããã¯ãGroupIdïŒArtifactIdïŒããŒãžã§ã³ãå€æŽãããããã«çºçããŸãã
- ã³ãŒãã¯1ã€ã®SVNãã©ã«ããŒã«æ ŒçŽãããŠããããã§ãïŒsvn-externalsã䜿çšããŠïŒå®å šã«ç°ãªããã®ããã§ãã¯ã¢ãŠãããå¿ èŠããããŸãã éæã§ã¯ãªã-麻é è¬;
äºåºŠç®ã®è©Šã¿
æ°åã®å埩ã§éçºãããã¢ã»ã³ããªãå®è£ ãã2åç®ã®è©Šã¿ã
å埩1
ãŸããåã ã®ã¢ãžã¥ãŒã«ãšè£œåå šäœã®äž¡æ¹ã®ã³ãŒããä¿®æ£ããã¡ã«ããºã ïŒããŒãžã§ã³ã®ãªãªãŒã¹ïŒãååŸããå¿ èŠããããŸããã ãããè¡ãããã«ãsvn-externalsã®äœ¿çšãåãé€ããŸããã åã¢ãžã¥ãŒã«ã¯ç¬ç«ããŠããããšãå€æããåå¥ã«çµã¿ç«ãŠãããŸããã ã¢ãžã¥ãŒã«ãæçµã¢ã»ã³ããªã«çµã¿èŸŒãã ãã¹ãŠã®äŸåé¢ä¿ã
芪pom.xmlãã¿ã¹ã¯ã«åŸã£ãŠå€æŽãããŠããŸãã ãã¹ãŠã®ã¢ãžã¥ãŒã«ããããããŒã¹ãšããŠäœ¿çšããŸãã
æ°ããããŒã¹pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <!-- --> <groupId>sx.config</groupId> <artifactId>main-settings</artifactId> <version>1.1-SNAPSHOT</version> <packaging>pom</packaging> <!--URL SVN--> <scm> <connection>scm:svn:svn://svn-server/maven/main-settings/trunk</connection> </scm> <!-- --> <pluginRepositories> <pluginRepository> <id>sx-repository</id> <url>http://v5-neptun/nexus/content/repositories/sx-repository</url> </pluginRepository> </pluginRepositories> <!-- --> <repositories> <repository> <id>sx-repository</id> <url>http://v5-neptun/nexus/content/repositories/sx-repository</url> </repository> <repository> <id>releases-repository</id> <url>http://v5-neptun/nexus/content/repositories/releases</url> </repository> <repository> <id>snapshots-repository</id> <url>http://v5-neptun/nexus/content/repositories/snapshots</url> </repository> <repository> <id>central-repository</id> <url>http://v5-neptun/nexus/content/repositories/central</url> </repository> </repositories> <profiles> <profile> <id>production</id> <!-- . --> <distributionManagement> <repository> <id>ftp-repository</id> <url>ftp://ftp.sample.com/builds</url> </repository> </distributionManagement> </profile> <profile> <id>development</id> <activation> <activeByDefault>true</activeByDefault> </activation> <!-- --> <distributionManagement> <snapshotRepository> <id>snapshots-repository</id> <url>http://v5-neptun/nexus/content/repositories/snapshots</url> </snapshotRepository> <repository> <id>releases-repository</id> <url>http://v5-neptun/nexus/content/repositories/releases</url> </repository> </distributionManagement> </profile> </profiles> <!-- --> <build> <defaultGoal>package</defaultGoal> <!-- --> <sourceDirectory>src</sourceDirectory> <testSourceDirectory>test</testSourceDirectory> <!-- --> <resources> <resource> <directory>src</directory> <includes> <include>**/*.properties</include> <include>**/*.sql</include> <include>**/*.xml</include> </includes> </resource> </resources> <extensions> <!-- Enabling the use of FTP --> <extension> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-ftp</artifactId> <version>1.0-beta-6</version> </extension> </extensions> <plugins> <!-- --> <!-- --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.2</version> <configuration> <!-- --> <warSourceDirectory>sx-war</warSourceDirectory> <attachClasses>true</attachClasses> </configuration> </plugin> <!-- , out of memory--> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <configuration> <minmemory>256m</minmemory> <maxmemory>512m</maxmemory> </configuration> </plugin> <!-- --> <plugin> <artifactId>maven-resources-plugin</artifactId> <version>2.4.3</version> <configuration> <encoding>cp1251</encoding> </configuration> </plugin> <!-- --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-scm-plugin</artifactId> <version>1.4</version> <configuration> <username>${SvnUsername}</username> <password>${SvnPassword}</password> </configuration> </plugin> <!-- --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <configuration> <tagBase>svn://gelios/cms/maven/main-settings/tags</tagBase> <branchBase>svn://gelios/cms/maven/main-settings/branches</branchBase> <preparationGoals>clean install</preparationGoals> <goals>deploy</goals> <autoVersionSubmodules>true</autoVersionSubmodules> </configuration> </plugin> </plugins> </build> </project>
å埩2
ããŒãžã§ã³ãªãªãŒã¹ãã©ã°ã€ã³ã¯ããã¹ãŠã®ãããžã§ã¯ãã¢ãžã¥ãŒã«ã«å®è£ ãããŠããŸãã ãããè¡ãããã«ãåã¢ãžã¥ãŒã«ã«ãããã¯ãè¿œå ãããŸããã
ãªãªãŒã¹ãªãªãŒã¹ãã©ã°ã€ã³æ¥ç¶
<!-- SVN. --> <scm> <connection>scm:svn:svn://svnserver/module/trunk</connection> </scm> <build> <plugins> <!-- --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <configuration> <!-- SVN --> <tagBase>svn://svnserver/module/tags</tagBase> <branchBase>svn://svnserver/module/branches</branchBase> <preparationGoals>clean install</preparationGoals> <goals>deploy</goals> <autoVersionSubmodules>true</autoVersionSubmodules> </configuration> </plugin> ... </plugins>
ãã®æ§æãåºæ¬pom.xmlã«åã蟌ã¿ãArtifactId-Versionããããã£ã䜿çšããããšãæ€èšããŸãããããã¹ãŠã®ãããžã§ã¯ãã§ã¯ãã®å€ã¯ãªããžããªå ã®ãã©ã«ããŒã®ååãšäžèŽããŸããã ãããã£ãŠãã¢ã€ãã¢ã¯ããè¯ãæ代ãŸã§å»¶æãããŸããã æåã®ããŒãžã§ã³ã¯ããã¹ãŠã®pom.xmlã¢ãžã¥ãŒã«ã®åºæ¬ãåãåããŸããã
æ°ãããããã¡ã€ã«ãããŒã¹pom.xmlã«è¿œå ãããŸããïŒproductionã ã¢ã»ã³ããªãäŒæ¥ã®FTPã«ã¢ããããŒãããåŸã§ãããžã§ã¯ãã«æ¡åŒµã§ããŸãã
å埩3
jar-hellãšã®äžæå¿«ãªè¡çªã®åŸããã¹ãŠã®ã¢ã»ã³ããªã§ã©ã€ãã©ãªãæŽçããããšã決å®ãããŸããã ã«ãŒãã«ã«ã¯100ãè¶ ããã©ã€ãã©ãªããããã»ãšãã©ãã¹ãŠã®ããŒãžã§ã³ããªãã£ããããç°¡åã§ã¯ãããŸããã§ããã åããŒãžã§ã³ã¯ãããŒãžã§ã³ããèšç®ãããããã«ãå ¬éãªããžããªã§èŠã€ããå¿ èŠããããŸããã ããµãã©ã€ãºãã®ã©ã€ãã©ãªã¯ãå éšã¢ã»ã³ããªãšããããä¿®æ£ããŒãžã§ã³ã§éãããŸããã ã¢ãŒãã£ãã¡ã¯ãã®åº§æšã¯ä¿æããŸãããããŒãžã§ã³ã§ã¯postscript _customã䜿çšããŠãMavenãªããžããªã«æ éã«é 眮ããŸããã
NexusããªããžããªãšããŠäœ¿çšããŸãã ãã£ãã·ã¥ä»ãã®ãããªãã¯ãªããžããªãžã®ã²ãŒããŠã§ã€ãèšå®ãããŸããã åäžã®ãšã³ããªãã€ã³ãããããŸããã³ãŒãã¬ãŒãMavenãªããžããªã§ãã ãã以åã¯ãã©ã€ãã©ãªããªãªãŒã¹ããã€ãªãŒãã«ãããã®ä»ã®ãããªãã¯ãªããžããªã®3ã€ä»¥äžããããŸããã ãã¹ãŠã®å¿ èŠãªæ¿èªã åpom.xmlã®3ã€ã®åæ§ã®ãªããžããªãããã«settings.xmlã®ã¢ã¯ã»ã¹èšå®ã§ãããåžžã«æ··ä¹±ãåŒãèµ·ãããŸããã
ããŒã¹ã®pom.xmlã«ã®ã¿ãªããžããªãžã®ãªã³ã¯ãæ®ãããšããŸããã ããã¯éåžžã«çŸå®çã§ãããã¢ãžã¥ãŒã«ã®æåã®ã¢ã»ã³ããªäžã«ãMavenã¯ãªããžããªããããŒã¹ã¢ãžã¥ãŒã«ãããŒãããå¿ èŠãããããã®åº§æšã¯äžæã§ãã ãã¹ãŠãæ£åžžã«åäœããåŸãæåã§è¡ãããšãã§ããŸãã ãã®ã¢ã¯ã·ã§ã³ã®äžéæ床ã«ããæåŠãããŸããã
å埩4
Hudsonã®ç¶ç¶çã€ã³ãã°ã¬ãŒã·ã§ã³ã·ã¹ãã ã§ããã¹ãŠã®åºæ¬ã¢ãžã¥ãŒã«ãšèšèšã¢ãžã¥ãŒã«ã®ãã€ããªãŒãã«ããã»ããã¢ããããŸããã ã¢ãžã¥ãŒã«ã¯å®å šã«ç¬ç«ããŠãããããåé¡ã¯ãããŸããã§ããã ãããªãã¯ã©ã€ãã©ãªã§ããããžã§ã¯ãã¢ãžã¥ãŒã«ã§ãéãã¯ãããŸããã MavenããŒã¹ã®ãã«ãã¯ãSVNã§ã³ãŒããå€æŽããããã³ã«å®è¡ãããæåããã¢ãŒãã£ãã¡ã¯ããNexusãªããžããªã«å ¥ããŸãã
æéãçµã€ã«ã€ããŠãã¿ã¹ã¯ã®ã¢ãžã¥ãŒã«ã®ã«ã¹ã±ãŒãã¢ã»ã³ããªãããã³éçºçšã¢ã»ã³ããªãšãã¹ãçšã¢ã»ã³ããªãžã®å±éãæ§æããŸããã å±éã¯ãããªãåçŽãªantã¹ã¯ãªããã䜿çšããŠå®è¡ãããŸãã Nexusããææ°ã®ã¢ãžã¥ãŒã«ã¢ã»ã³ããªïŒ äŸåé¢ä¿ïŒget ïŒãæœåºãããµãŒããŒã§è§£åããŠã¢ããªã±ãŒã·ã§ã³ãµãŒããŒãåèµ·åããŸãïŒã¹ã¯ãªããèªäœã¯èšäºã®æåŸã«ãããŸãïŒã
é·æ
- åã¢ãžã¥ãŒã«ãåå¥ã«äœ¿çšã§ããŸãã
- ãã¹ãŠã®äŸåã¢ãžã¥ãŒã«ã®ããŒãžã§ã³ãä¿®æ£ããããšã«ããããããžã§ã¯ãã³ãŒãå šäœãã³ãããã§ããŸãã
- ç¶ç¶çãªçµ±åã«ãããæ¥åžžçãªäœæ¥ãäžèŠã«ãªããæ©èœãçç£çãªç°å¢ãšé¡§å®¢ã«è¿ éã«ç§»è¡ã§ããŸãã
- ã¢ãžã¥ãŒã«ããŒãžã§ã³ã®ãªãªãŒã¹ã¯å®å šã«å¶åŸ¡ãããéåžžã«ç°¡åã§ãã
- ããã§ãç¹å®ã®ã¢ãžã¥ãŒã«ã1ã€ã ã䜿çšããŠéçºã§ããŸãã å®éãããã€ãã®ã¢ãžã¥ãŒã«ã®äžè¬çãªå±éã¯ãã³ãŒãã®æçµçãªåäœã«åœ±é¿ãäžããå¯èœæ§ããããŸãã
- ãããœã³ã®ãããã§ã誰ãã¢ã»ã³ããªãç Žã£ãã®ããåžžã«ç¢ºèªã§ããŸãã
- ãããžã§ã¯ããèšå®ããå¿ èŠã¯ãŸã£ãããªããIDEã¯ãã¹ãŠãåç¬ã§è¡ããŸãã ã¢ã»ã³ããªãéå§ããã ãã§ååã§ãïŒmvnããã±ãŒãžã§ååã§ãïŒã
- ã¢ãžã¥ãŒã«ãäŸåããã³ãŒãã¯åžžã«æ確ã§ãã ãããŠä»¥åã¯ããã©ã³ã¯ã¯åžžã«ãšã©ãŒãå£ããã³ããããªã©ãè¡ã£ãŠããŸããã
çæ
- IDEã«ã¯ãã¹ãŠã®ã¢ãžã¥ãŒã«ã«å ±éã®ãããžã§ã¯ãããªããããäžåºŠã«è€æ°ã®ã¢ãžã¥ãŒã«ãå€æŽããã«ã¯ãåã¢ãžã¥ãŒã«ã§åå¥ã«äœæ¥ããå¿ èŠããããŸãã ã¢ãžã¥ãŒã«ã¯èªçµŠèªè¶³ã§ããå¿ èŠããããããããã¯ç¢ºãã«ããŸã䟿å©ã§ã¯ãããŸããããæŠå¿µçã«æ£ããã§ãã
- ã¡ã€ã³è£œåããªãªãŒã¹ãããšãã«ãã«ã¹ã±ãŒãã§ãã¹ãŠã®ããŒãžã§ã³ã®ã³ã³ããŒãã³ãããªãªãŒã¹ããããšã¯ã§ããŸãã
- ...
ãœãªã¥ãŒã·ã§ã³ãéçºããŸã
ãã®ããã»ã¹ã§ã¯ãã¢ã»ã³ããªãç·šéãããŸãã ãæãªããã®æ¹æ³ãããŸã çµã¿ç«ãŠãŠãã人ã®ããã«ããã¬ããžããŒã¹ã®ããŒãžãéãããããã«ã¯ã¢ãžã¥ãŒã«ã®äŸåé¢ä¿ãå«ãŸããŠããŸãã ãã®æ å ±ã¯ãHomsonã®åå¥ã®ã¿ã¹ã¯ãšããŠpom.xmlã¢ãžã¥ãŒã«ã«åºã¥ããŠæ¯æ©æŽæ°ãããŸãïŒ DRYãå¿ããªãã§ãã ããïŒã
ã¢ãžã¥ãŒã«ã®ã¢ã»ã³ããªãé«éåããããã«ãã¢ã»ã³ããªäžã®äžèŠãªäœæ¥ã¯é€å€ãããŸããã ããšãã°ãã³ã¢ã«äŸåããsoapã¢ãžã¥ãŒã«ãæ§ç¯ããŸãã ã³ã¢ã³ãŒãã¯æçµçãªSOAPã¢ã»ã³ããªã«ãªããŸãã 次ã¯ãã³ã¢ãšç³é¹žã«äŸåãããããžã§ã¯ãã§ãã soapã¯åå¥ã«ã¯äœ¿çšãããªããããã³ã¢ã¯ã¢ã»ã³ããªããé€å€ããããããžã§ã¯ãã«å«ãŸããŸãã ãããã£ãŠãã¢ã»ã³ããªãé«éåããŸãã äŸåã³ã¢ãå«ãSOAPãæ§ç¯ããããã«ãå¿ èŠã«å¿ããŠéå§ãããã³ã³ããã¹ããããã¡ã€ã«ãè¿œå ãããŸããã
ãã¹ãŠã®ã¢ãžã¥ãŒã«ãpom.xmlã§2åæ€åºãããããšã«æ°ä»ãããšãã§ããŸãã1ã€ã®ã¬ã³ãŒããã³ã³ãã€ã«äžã«äœ¿çšããã2çªç®ã®ã¬ã³ãŒãã¯ã¢ãžã¥ãŒã«ããããã€ã¡ã³ãã§çµäºããããšãæå³ããŸãã pom.xmlå šäœã§ã¢ãžã¥ãŒã«ã®ããŒãžã§ã³ã眮ãæããªãããã«ãäŒæ¥ã¢ãžã¥ãŒã«ã®ãã¹ãŠã®ããŒãžã§ã³ã¯åå¥ã®ããããã£ã«ç§»åããããã¡ã€ã«ã®å é ã«é 眮ãããŠããŸãã ããã«ãããå¥ã®ããŒãžã§ã³ã«åãæ¿ãããšãã«ãšã©ãŒãçºçããå¯èœæ§ãäœããªããŸãã
ããããã£ã䜿çšããŠããŒãžã§ã³ãä¿åãã
<!-- . , --> <properties> <sx.core>4.5-SNAPSHOT</sx.core> </properties> ... <profiles> <profile> <!-- --> <id>context</id> <dependencies> <dependency> <groupId>sx.core</groupId> <artifactId>core</artifactId> <version>${sx.core}</version> <type>war</type> <!-- maven-overlay --> <scope>runtime</scope> </dependency> </dependencies> </profile> </profiles> <!-- --> <dependencies> <dependency> <groupId>sx.core</groupId> <artifactId>core</artifactId> <version>${sx.core.core}</version> <classifier>classes</classifier> <!-- \ --> <scope>provided</scope> </dependency> ... </dependencies>
Mavenã¢ãŒãã£ãã¡ã¯ããæäœããããã®antã¹ã¯ãªãã
ãããã«
ãã®ãããç¶ç¶çãªçµ±åããããžã§ã¯ãã«å°å ¥ãããŸããã ãµãŒããŒã§ã³ãŒããæåã§æŽæ°ããå¿ èŠã¯ãªããªããŸããã RSSçµç±ã§éä¿¡ãããã¢ã»ã³ããªã®çµæã¯åžžã«è¡šç€ºãããŸãã ã¢ã»ã³ããªç£èŠã®å€§ç»é¢ã¯ãŸã èšå®ãããŠããŸããã
æ°ããéçºè ã¯ãã¢ã»ã³ããªã®ã»ããã¢ããã«ããŸãæéããããŸããã ãããŠããã¯æ¥œããã ãã§ãã
ã³ãŒãããŒãžã§ã³ã®ãªãªãŒã¹ã調æŽããããã®ããã»ã¹ã¯ã»ãŒå®å šã«èªååãããããã»ã©æéã¯ããããŸããã 以åã«ãªãªãŒã¹ãããããŒãžã§ã³ã®ä¿å®ãã¯ããã«ç°¡åã«ãªããŸããã
æ°ããéçºã¯ãæ¥äžã¯éçºã³ã³ããã¹ãã«åé¡ãããŸããã€ãŸãã顧客ã«ããæ©ãå±ããŸãã é£ããçµ±åãšã©ãŒãçºçãå§ããŸãããã€ãŸããããè¿ éã«ä¿®æ£ã§ããŸãã
æŽæ°ïŒã³ã¡ã³ããŒã¿ãŒããã®å®è£ çµéšã«é¢ããæçšãªèšäºïŒ http : //bazhenov.me/blog/2011/04/09/build.html