tanamonの稀に良く書く日記

KEEP CALM AND DRINK BEER

mvn sysdeo-tomcat:generateとmvn sysdeo-tomcat:m2eclipseの違い

mvn eclipse:eclipseとmvn eclipse:m2eclipseの違い
の続き。今度は、

mvn sysdeo-tomcat:generate

と、

mvn sysdeo-tomcat:m2eclipse

で、生成されるファイルの中身を比べてみた。
結論としては、sysdeo-tomcat:generateの方を使うべき。

pom.xmlの準備

<build>
  ...
  <pluginManagement>
    <plugins>
      ...
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>sysdeo-tomcat-maven-plugin</artifactId>
        <version>1.1</version>
      </plugin>
    </plugins>
  </pluginManagement>

  <plugins>
    ...
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>sysdeo-tomcat-maven-plugin</artifactId>
      <version>1.1</version>
    </plugin>
  </plugins>
</build>

.projectファイル

sysdeo-tomcat:generate
<projectDescription>
  <name>myproject_original</name>
  <comment></comment>
  <projects/>
  <buildSpec>
    <buildCommand>
      <name>org.eclipse.jdt.core.javabuilder</name>
    </buildCommand>
    <buildCommand>
      <name>org.maven.ide.eclipse.maven2Builder</name>
    </buildCommand>
  </buildSpec>
  <natures>
    <nature>org.eclipse.jdt.core.javanature</nature>
    <nature>org.maven.ide.eclipse.maven2Nature</nature>
    <nature>com.sysdeo.eclipse.tomcat.tomcatnature</nature>
  </natures>
</projectDescription>
sysdeo-tomcat:m2eclipse
<projectDescription>
  <name>myproject_original</name>
  <comment></comment>
  <projects/>
  <buildSpec>
    <buildCommand>
      <name>org.eclipse.jdt.core.javabuilder</name>
    </buildCommand>
    <buildCommand>
      <name>org.maven.ide.eclipse.maven2Builder</name>
    </buildCommand>
  </buildSpec>
  <natures>
    <nature>org.eclipse.jdt.core.javanature</nature>
    <nature>org.maven.ide.eclipse.maven2Nature</nature>
    <nature>com.sysdeo.eclipse.tomcat.tomcatnature</nature>
  </natures>
</projectDescription>

どっちも同じで、

    <nature>com.sysdeo.eclipse.tomcat.tomcatnature</nature>

この行が追加される。

.tomcatpluginファイル

sysdeo-tomcat:generate
<?xml version="1.0" encoding="UTF-8"?>
<tomcatProjectProperties>
    <rootDir>src/main/webapp</rootDir>
    <exportSource>false</exportSource>
    <reloadable>true</reloadable>
    <redirectLogger>true</redirectLogger>
    <updateXml>true</updateXml>
    <warLocation></warLocation>
    <extraInfo>
	  
    </extraInfo>
    <webPath>/myproject-1.0-SNAPSHOT</webPath>
    <webClassPathEntries>
          <webClassPathEntry>/myproject/target/classes</webClassPathEntry>
          <webClassPathEntry>M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar</webClassPathEntry>
          <webClassPathEntry>M2_REPO/org/apache/wicket/wicket/1.4-rc4/wicket-1.4-rc4.jar</webClassPathEntry>
          <webClassPathEntry>M2_REPO/org/slf4j/slf4j-api/1.4.2/slf4j-api-1.4.2.jar</webClassPathEntry>
          <webClassPathEntry>M2_REPO/org/slf4j/slf4j-log4j12/1.4.2/slf4j-log4j12-1.4.2.jar</webClassPathEntry>
    </webClassPathEntries>
</tomcatProjectProperties>
sysdeo-tomcat:m2eclipse
<?xml version="1.0" encoding="UTF-8"?>
<tomcatProjectProperties>
    <rootDir>src/main/webapp</rootDir>
    <exportSource>false</exportSource>
    <reloadable>true</reloadable>
    <redirectLogger>true</redirectLogger>
    <updateXml>true</updateXml>
    <warLocation></warLocation>
    <extraInfo>
	  
    </extraInfo>
    <webPath>/myproject-1.0-SNAPSHOT</webPath>
    <webClassPathEntries>
          <webClassPathEntry>/myproject/target/classes</webClassPathEntry>
          <webClassPathEntry>C:\Documents and Settings\tanamon\.m2\repository/log4j/log4j/1.2.14/log4j-1.2.14.jar</webClassPathEntry>
          <webClassPathEntry>C:\Documents and Settings\tanamon\.m2\repository/org/apache/wicket/wicket/1.4-rc4/wicket-1.4-rc4.jar</webClassPathEntry>
          <webClassPathEntry>C:\Documents and Settings\tanamon\.m2\repository/org/slf4j/slf4j-api/1.4.2/slf4j-api-1.4.2.jar</webClassPathEntry>
          <webClassPathEntry>C:\Documents and Settings\tanamon\.m2\repository/org/slf4j/slf4j-log4j12/1.4.2/slf4j-log4j12-1.4.2.jar</webClassPathEntry>
    </webClassPathEntries>
</tomcatProjectProperties>

sysdeo-tomcat:m2eclipseのほうは絶対パスが出力されてしまう。