-source 1.3 �ǥ��ݡ��Ȥ���Ƥ��ޤ��� �Ȥ��������� ���������ΥС������ - TzlTTqTj�������򻲹ͤˤ����Ƥ��������ޤ������ӥ�ɤ�����򲼵��Τ褦�˽��ؤ���Ф褤 <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> </plugins> </build> �����target�����ˤĤŤ��� <encoding>Windows-31J</encoding> �Ȥ����ꤹ��С�ʸ�����󥳡��ǥ��󥰤ˤ�륳��ѥ��륨�顼�ʤɤ����Ǥ���ݤ��� �ե����� ���ե������Ȥ� mvn complie�Ȥ�mvn install�Ȥ����ץ��������Ȥ�ӥ�ɤ��뤿��ΰ�Ĥν��ޤ�Τ��ȡ��ե���������ꤹ��Ȥ���˴�Ϣ�դ��������뤬��İʾ�¹Ԥ���롣��Ϣ�Ť��ϡ����Υץ��������ȤΥ����ƥ��ե����ȤΥ����פ�pom.xml�ξ��󤫤顢Maven�������Ƚ�Ǥ���餷���� �ޤ��ե������ˤ� validate -> compile -> test -> deploy�ʤɤȼ¹Խ���ʤɤ��������Ƥ��롣�����ӥ�ɥ饤�ե�������Ȥ����� �ǥե���ȤΥ饤�ե�������� ${MAVEN_HOME}/lib/maven-core-2.0.7-uber.jar#META-INF/plexus/components.xml ���������Ƥ��롣components.xml ��ݥ��ȥ�˥ץ�������ͳ����³���� ��~/.m2/settings.xml �˰ʲ��ε��Ҥ�񤤤Ƥ����ޤ��� <settings> <proxies> <proxy> <active>true</active> <protocol>http</protocol> <host>hogehoge.jp</host> <port>81</port> <username>fuga</username> <password>fuga</password> <nonProxyHosts>www.google.com|*.hoge.jp</nonProxyHosts> </proxy> </proxies> </settings> �ץ��������Ⱥ����� ��mvn archetype:create -DgroupId=nu.mine.kino.mavensample -DartifactId=kino-app ���롼��ID�ȥץ饰����ID����ꤹ���Ǥ��͡� pom.xml����Eclipse�Υץ��������Ȥ��������롣 ��mvn eclipse:eclipse �����Eclipse��Ϣ�Υե����뤬�Ǥ�������ޤ����ʸ塢Eclipse��Ǵ����Ǥ���櫓�Ǥ��͡� ���Ϥ����ե�������� M2_REPO �Ȥ����ѿ�����Ѥ��Ƥ���Τǡ�Eclipse���ѿ��Ȥ���M2_REPO��������Ƥ����ޤ����ͤϥ��������ݥ��ȥ�ؤΥѥ�����ꤷ�Ƥ����ޤ��� �ץ��������Ȥι�������Ϥ��� ���̾�pom.xml�ϥǥե�����ͤϾ�ά����ޤ�����������ά���ʤ��ǽ��Ϥ��ޤ��� mvn projecthelp:effective-pom ���󥽡���� <?xml version="1.0"?><project> <modelVersion>4.0.0</modelVersion> <groupId>nu.mine.kino.mavensample</groupId> <artifactId>kino-app</artifactId> <name>kino-app</name> <version>1.0-SNAPSHOT</version> <url>http://maven.apache.org</url> <build> <sourceDirectory>t:\workspace3.2\kino-app\src\main\java</sourceDirectory> <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory> <testSourceDirectory>t:\workspace3.2\kino-app\src\test\java</testSourceDirectory> <outputDirectory>t:\workspace3.2\kino-app\target\classes</outputDirectory> <testOutputDirectory>t:\workspace3.2\kino-app\target\test-classes</testOutputDirectory> <resources> <resource> <directory>t:\workspace3.2\kino-app\src\main\resources</directory> </resource> </resources> <testResources> <testResource> <directory>t:\workspace3.2\kino-app\src\test\resources</directory> </testResource> </testResources> <directory>t:\workspace3.2\kino-app\target</directory> <finalName>kino-app-1.0-SNAPSHOT</finalName> <plugins> <plugin> <artifactId>maven-projecthelp-plugin</artifactId> <version>2.0-beta-1</version> </plugin> </plugins> </build> <repositories> <repository> <snapshots> <enabled>false</enabled> </snapshots> <id>central</id> <name>Maven Repository Switchboard</name> <url>http://repo1.maven.org/maven2</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> <id>central</id> <name>Maven Plugin Repository</name> <url>http://repo1.maven.org/maven2</url> </pluginRepository> </pluginRepositories> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <reporting> <outputDirectory>target/site</outputDirectory> </reporting> </project> �����Ϥ���ޤ������ե�����˥�����쥯�Ȥ��ơ����礳���礳�Խ����ƻȤ����Ȥ��Ǥ��������Ǥ����ǥե�����ͤ��ǤƤ�Τ��褤�Ǥ��͡� settings.xml�ι�������Ϥ��� ��mvn help:effective-settings -Doutput=effective-settings.xml �ǥǥե���Ȥ�settings.xml�����Ϥ���� ���������ݥ��ȥ���ѹ����� ���ǥե���Ȥ� ~/.m2/repository �Υ�ġ�Maven�Υ��󥹥ȡ���ǥ��쥯�ȥ��۲��ʤɤˤ��롢settings.xml���ѹ���ǽ�Ǥ��� <?xml version="1.0"?><settings> <localRepository>~/.m2/repositoryNew</localRepository> <-����ʴ����� <servers>... </servers> </settings> http://slashdot.jp/~pluto/journal/328571 ��¸����饤�֥����ɲä��� ��Maven��ɬ�פʥ饤�֥�꤬��������ˤ��뤫��õ�����ʤ��ä���ͥåȾ�Υ�ݥ��ȥ��õ���˹Ԥ��ޤ�����ɬ�פʥ饤�֥��Ǥ�����pom.xml�ǰʲ��Τ褦�˻��ꤷ�ޤ��� <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> dependencies���ʣ�������� </dependencies> <groupId /> <artifactId /> <version /> ��ɬ�ܤߤ����Ǥ��͡� �����Ȥ�������� ���������������Ȥˡ��͡��ʾ����ܤ��� ����������jar�ˤ��� ��mvn package ��jar����������ޤ��� ���������ݥ��ȥ��jar�����֤��� ��mvn install �dz����ץ��������Ȥ����������ݥ��ȥ�(~/.m2�Τ��ȤǤ�)�˥��󥹥ȡ��뤵��ޤ���ʣ���Υץ��������Ȥ���¸�����äƤ빽���dz�ȯ����Ȥ��ϥ��������ݥ��ȥ�˼�ʬ�Υ饤�֥��򥤥󥹥ȡ��뤹�뤳�Ȥǡ��Ƶ�Ū(��)�˳�ȯ����Ф褤�Τ��ʡ��Ĥޤ� ProjectA ProjectB <- ProjectA�˰�¸���Ƥ� ��硢�ޤ�ProjectA��install���ơ����ProjectB��pom.xml��ProjectA�˰�¸���Ƥ롢�Ƚ񤤤Ƥ������ȡ� ���ʤߤ˥��󥹥ȡ��뤷���Ȥ��Υǥ��쥯�ȥ깽���Ǥ��� groupId(��.��/���ڤä����)/artifactId �Ȥʤ�Τ�groupId��Ŭ�٤�Ĺ���ˤ��Ƥ����������ɤ������Ǥ���Eclipse�Υץ饰����ID���ȼ��Ԥ����(����`;)���⤦��ä���ä�(����`;) ���������ݥ��ȥ��Ǥ�դ�jar���ɲä��� �����Ȥ��аʲ��Υ��ޥ�ɤ� mvn install:install-file -DgroupId=javax.transaction -DartifactId=jta \ -Dversion=1.0.1B -Dpackaging=jar -Dfile=jta-1_0_1B.jar jta-1_0_1B.jar �Ȥ����ե����뤬��Υ��롼��ID,�ץ饰����ID,�С������ǥ��������ݥ��ȥ���ɲä���ޤ��� Maven��pom.xml�Υ������� ��pom.xml������ ��site:deploy�ǡ��������������Ȥ�WEB�˸������롣 ��mvn clean site-deploy �ǡ�html�ɥ�����Ȥ�������ƽ���Υ����Ф˥��åפ��뤳�Ȥ��Ǥ��ޤ���pom.xml�ˤϰʲ������Ƥ�񤤤Ƥ���ɬ�פ�����ޤ��� <?xml version="1.0"?> <project> <modelVersion>4.0.0</modelVersion> <groupId>nu.mine.kino.mavensample</groupId> <artifactId>kino-app</artifactId> <name>kino-app</name> <version>1.0-SNAPSHOT</version> <url>http://maven.apache.org</url> <ciManagement> ά <distributionManagement> <site> <id>ftp-site</id> ���ץå���Υǥ��쥯�ȥ� <url>ftp://[������̾]/var/www/html/hoge</url> </site> </distributionManagement> <build> <extensions> <extension> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-ftp</artifactId> <version>1.0-beta-2</version> </extension> </extensions> <sourceDirectory>source</sourceDirectory> ά </project> �����Ǥ�FTP�ǥ��åפ���褦���ꤷ�Ƥ���Τǡ� ~/.m2/settings.xml �˥��åפ���FTP��������Ȥ���ꤷ�Ƥ���ɬ�פ�����ޤ���
�ʾ�ǣϣˤǤ������äƤ��������Ȥ����Ǥ������ʤ�����������Ǥ⼺�Ԥ����㤤�ޤ������ͥåȤˤ���ޤ���󤬤ʤ��Ȥ����ò¸«¤ï¿½È´Ä¶ï¿½ï¿½ï¿½Â¸ï¿½Ê¤Î¤ï¿½ï¿½â¤·ï¿½ï¿½Ê¤ï¿½ï¿½Î¤Ç¤ï¿½ï¿½ï¿½ï¿½ï¿½ bash-3.2$ mvn site:deploy [INFO] [site:deploy] [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Wagon protocol 'ftp' doesn't support directory copying [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ �Ȥ����褦�ˡ��ʤ��� Wagon protocol 'ftp' doesn't support directory copying �äƤǤ��㤦��Ǥ��͡� site:deploy��FTP�˼��Ԥ��롣 ������ Wagon protocol 'ftp' doesn't support directory copying ���äǤ����ɤ���Ĵ�٤Ƥ����� Maven Wagon�äƤΤ�Maven����dz�ȯ����Ƥ���饤�֥�귲�Τ褦�Ǥ���������pom.xml�ˤ⤢��褦�ˡ� wagon-ftp �� 1.0-beta-2 �Ȥ����С�������jar���Ȥ��줬�Ǥ��㤦�ߤ������äƤ��äƤ⤳�줬Maven�Υ�ݥ��ȥ���κǿ��Ǥߤ����ʤΤǡ�����äȺ��äƤޤ����� ���Maven��Subversion��trunk����ǿ��Υ��������äƤ��ơ�jar��������ޤ���������Ū�ˤ� Wagon��������Subversion��URL���ǧ���� /trunk/wagon-providers �� /tags/wagon-1.0-beta-2/wagon-providers ��checkout���ơ�wagon-1.0-beta-2 �� FtpWagon?.java ��ǿ��Ⱥ����ؤ��� cd wagon-1.0-beta-2/wagon-providers/wagon-ftp mvn clean package ��jar����ľ���ƥ��������ݥ��ȥ��jar�òº¹¤ï¿½ï¿½Ø¤ï¿½ï¿½ï¿½ï¿½ã¤¤ï¿½Þ¤ï¿½ï¿½ï¿½ï¿½ï¿½ ����Ǥ�Ǥ���FTP�ץåȤ��Ǥ���褦�ˤʤ�ޤ����� jar��Ʊ������꥽��������ꤹ�롣 ���ǥե���ȤǤ�src/main/resources/��Υե�����ϥѥå������󥰻��˼�ưŪ��jar��ľ���˳�Ǽ�����褦�Ǥ��� �㤨��Eclipse�Υץ饰����Τ褦�˥ץ���������ľ��(�Ĥޤ�pom.xml�ΤȤʤ�)��¸�ߤ���ե������jar�˳�Ǽ���������� <build> <sourceDirectory>source</sourceDirectory> <scriptSourceDirectory>main/scripts</scriptSourceDirectory> <testSourceDirectory>test</testSourceDirectory> <outputDirectory>classes</outputDirectory> <testOutputDirectory>target\test-classes</testOutputDirectory> <resources> <resource> <directory>.</directory> <-������ <includes> <include>plugin.xml</include> <include>plugin.properties</include> </includes> </resource> </resources> ................ </build> �Ȥ���Ф褤�� �ȼ���MANIFEST.MF��Ʊ���������� ��MANIFEST.MF��Maven�������Ʊ�������㤦���ɡ�Eclipse�Υץ饰�����MANIFEST.MF�˿�������òµ½Ò¤ï¿½ï¿½ï¿½Î¤Ç¡ï¿½ï¿½ï¿½ï¿½ï¿½ò¤½¤Î¤Þ¤Þ³ï¿½Ç¼ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Ç¤ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Ï¥×¥é¥°ï¿½ï¿½ï¿½ï¿½Ç¹Ô¤ï¿½ï¿½Þ¤ï¿½ï¿½ï¿½ <build> ....... <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifestFile>META-INF/MANIFEST.MF</manifestFile> <manifest> <addDefaultSpecificationEntries>false</addDefaultSpecificationEntries> <addDefaultImplementationEntries>false</addDefaultImplementationEntries> </manifest> ��������ĤϤޤ����������� </archive> </configuration> </plugin> ........... </plugins> </build> �Ǥ�ɤ���MANIFEST.MF���ɤ߹����Maven������ˤ����äƤ��ޤ��餷�������ޤ������ޤ���(����`;)�� http://maven.apache.org/plugins/maven-jar-plugin/source-repository.html ��ʬ�Ǻ�ä��㤦�� �ץ饰����Υ����������ɤ����ꤹ�� ������Ū��http://maven.apache.org/plugins/�Υץ饰����ΰ������顢Ĵ�٤����ץ饰����ò¤µ¤ï¿½ï¿½ï¿½ï¿½Æ¡ï¿½ï¿½ï¿½ï¿½Î¥×¥é¥°ï¿½ï¿½ï¿½ï¿½ï¿½Ñ¤Î¥ï¿½ï¿½ï¿½ï¿½È¤ï¿½ï¿½ï¿½ï¿½Ü¡ï¿½ï¿½ï¿½Çºï¿½ï¿½Î¥ï¿½Ë¥å¡¼ï¿½ï¿½ï¿½é¥½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Ý¥ï¿½ï¿½È¥ï¿½ï¿½URL���ñ¤¤¤Æ¤ï¿½ï¿½ï¿½Ú¡ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Ù¤Ð¤ï¿½ï¿½ï¿½ï¿½ï¿½ ������� ���ߤΥ�������:66333 |