pom.xmlã®ä¾åã©ã¤ãã©ãªã.classpathã«åæ ãããMavenãã©ã°ã¤ã³ã試é¨å ¬éãã¾ã
id:jflute ããã®エントリããã£ããã§ãã¼ãºããããããªãã¨ãããã£ãã®ã§ãå°ãåã«å人çã«ä½ã£ãMavenãã©ã°ã¤ã³ã試é¨å ¬éãã¾ãã
ã©ããªãã©ã°ã¤ã³?
ã²ã¨è¨ã§ããã¨ãMavenã®eclipseãã©ã°ã¤ã³ã¨dependencyãã©ã°ã¤ã³ã足ãã¦2ã§å²ã£ããããªæ©è½ãæä¾ãã¾ããeclipse+classpathãæåã£ã¦ãeclipathããã©ã°ã¤ã³ã(ç¸å¤ããããã¼ãã³ã°ã»ã³ã¹ããã¾ããããè¯ãã¢ã¤ãã¢åé)
å ·ä½çã«ã¯ãpom.xmlã«è¨è¿°ãããä¾åã©ã¤ãã©ãªãeclipseããã¸ã§ã¯ãä¸ã«ã³ãã¼ãã¦ã.classpath ã«ã¯ã©ã¹ãã¹ã追å ãã¾ããã¤ãã§ã«ã½ã¼ã¹ãJavadocãããã°èªåçã«ã¢ã¿ãããã¾ãã
pom.xmlã®ä¾åã©ã¤ãã©ãªã.classpathã«åæ ãããã ããªãã° mvn eclipse:eclipse ã§ã§ãã¾ãããããã ã¨æ¢åã® .classpath ãåçæãã¦ä¸æ¸ãããã¦ãã¾ãã¾ããeclipathãã©ã°ã¤ã³ã¯ãæ¢åã® .classpath ãèªã¿è¾¼ãã§å¤æ´ç¹ã ãä¿®æ£ããã®ã§ãeclipse ã«åªããããã¤ä¾åã©ã¤ãã©ãªç®¡çã¯ã¯pom.xmlã«éç´ã§ãã¾ãã
使ãæ¹
æ¬ãã©ã°ã¤ã³ã¯ seasar.org ã«ã¦å ¬éããã¦ããã ãã¦ããã®ã§ãpom.xml ã® pluginRepositoryã«seasar.orgã追å ãã¦ãã ããã
maven.seasar.org The Seasar Foundation Maven2 Repository http://maven.seasar.org/maven2
ãã¨ã¯ãplugins è¦ç´ ã®ä¸ã«ä»¥ä¸ã®ããã« maven-eclipath-plugin ã追å ããã ãã
æä½éãªãããã ãã§è¨å®å®äºã
ã»ã»ã»ã» ã»ã»ã»ã» org.seasar.uruma maven-eclipath-plugin
ãã¨ã¯ãã³ãã³ãã©ã¤ã³ãã
mvn eclipath:sync
ã¨æã¡ã¾ããããã§ãpom.xmlã®ä¾åã©ã¤ãã©ãª(jar)ã eclipse ããã¸ã§ã¯ãé ä¸ã® lib ãã£ã¬ã¯ããªã«ã³ãã¼ããã.classpath ã«ãããã®jarã¸ã®åç §ãèªåè¨å®ããã¾ãã.classpathãèªã¿è¾¼ãã§å·®åã ãæ´æ°ãã¦æ¸ãæ»ãä»æ§ãªã®ã§ãç¬èªã«ã¯ã©ã¹ãã¹ã³ã³ãããªã©ãè¨å®ãã¦ãã¦ãããããã®è¨å®ã¯æ®ããã¾ãã
ä¾åã©ã¤ãã©ãªãå¢ãããããã¼ã¸ã§ã³ã¢ããããã¨ãããpom.xml ãæ´æ°ã㦠eclipath:syncãæ°ãããã¼ã¸ã§ã³ã®jarã.classpathã«è¿½å ãã¦ãå¤ããã®ã¯åé¤ãã¾ãã
ãã ããå®å ¨ã®ããå¤ããã¼ã¸ã§ã³ã®jarèªä½ã¯eclipseããã¸ã§ã¯ãããåé¤ãã¾ãããå¤ããã¼ã¸ã§ã³ã®jarãåé¤ãããã¨ãã¯ã
mvn eclipath:clean
ã§jarãã¡ã¤ã«ãåé¤ãã¾ãã
ä½ãåé¤ããããäºåã«ç¢ºèªãããã¨ãã¯ã
mvn eclipath:check-clean
ã§åé¤ãããã¡ã¤ã«ã®ä¸è¦§ã ã表示ãã¾ãã
ã¾ããpom.xmlã® packaging ããã§ãã¯ãã¦ããã®ã§ãWebã¢ããªã±ã¼ã·ã§ã³ã§
ããã«scopeããã§ãã¯ãã¦ããã®ã§ãscopeãprovidedãtestã«ãªã£ã¦ããjarã¯ãsrc/main/web/WEB-INF/lib ã§ã¯ãªããlib ã«ã³ãã¼ããããã¾ãã(ãã®è¾ºã®ã³ãã¼å ã¯ç´°ããå¶å¾¡ãããã¨ããã¨è¨å®ãé¢åã«ãªãã®ã§ãeclipathãã©ã°ã¤ã³ã§åæã«ããªã·ã¼ã決ãã¦ãã¾ããå©ç¨è ãå¤ãããªãã°ãããããã¤ããã°ã§ç´¹ä»ãã¾ã)
ããã¡ãã£ã¨ç´°ããæ©è½ãããã¤ãããã¾ãããã¨ããããæä½éã®ä½¿ãæ¹ãç´¹ä»ãã¦ã¿ã¾ããã
ç¾æç¹ã§ã®å¶éäºé
- å©ç¨è ã®çæ§ã®ãæè¦ããä½è ã®æ°ã¾ããã§ãã©ã°ã¤ã³åãä»æ§ã¯å¤æ´ããå¯è½æ§ãããã¾ã
- ãã«ãã¢ã¸ã¥ã¼ã«ããã¸ã§ã¯ãã§ã¯ã¾ã 試ãã¦ãã¾ããã®ã§ä¸å ·åãã§ãããããã¾ãã
- Maven3.0ã§ã¯ä¸ååä½è©¦é¨ãã¦ãã¾ãã
- Windowsç°å¢ã§ãã試é¨ãã¦ãã¾ãã
- mvn eclipse:eclipse ã¨éã£ã¦ã.classpathãã¼ãããçæããæ©è½ã¯æä¾ãã¦ãã¾ããã(ä¾åã©ã¤ãã©ãªã«é¢ãã pom.xml 㨠.classpath ã®åæãåããã¨ã«ç¹åãã¦ãã¾ã)
- ã½ã¼ã¹ã³ã¼ãã®Javadocã¯è±èªã§æ¸ããã¨é å¼µã£ã¦éä¸ã§é¢åã«ãªãã¾ãã(ç¬)
è¦æ/ä¸å ·åå ±åãªã©ããã°ã³ã¡ã³ãããã ããã°å¯¾å¿æ¤è¨ãã¾ãã(ä»ãã¾ãæéãåããªãã®ã§ã対å¿ãé ããªãå¯è½æ§å¤§ã§ããã»ã»ã»)