インポートの結果作成された .project ファイルと、.classpath ファイルの中身を確認しておく。
.project :
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>scala-maven-sample</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.scala-ide.sdt.core.scalabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.scala-ide.sdt.core.scalanature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
buildCommand に maven2Builder が追加されている。
javabuilder の代わりに、scalabuilder が追加されている。
natures も scalanature と maven2Nature が追加されている。
scalanature は m2eclipse-scala が追加したものと思われる。
maven2Nature は m2e でインポートしたときに m2e が追加する nature。
.classpath :
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/scala">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/scala">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
src パス は src/main/scala と src/test/scala に自動的に通される。src/test/scala フォルダがない場合には警告対象になるので、警告を回避するならフォルダを作っておくか、このパスを削除する。
classpathentry に SCALA_CONTAINER と MAVEN2_CLASSPATH_CONTAINER が追加されている。
SCALA_CONTAINER は import 時に m2eclipse-scala が追加したもの。
MAVEN2_CLASSPATH_CONTAINER は、Eclipse で見たときの Maven Dependencies に当たる部分。
MAVEN2_CLASSPATH_CONTAINER は pom.xml から 依存ライブラリを探すため、
pom 由来の scala-library と SCALA_CONTAINER がバッティングしてしまっている。
settings 系は、m2e の時と同じで、m2eclipse-scala の設定は時にない。
0 件のコメント:
コメントを投稿