mvn scala:script -DscriptFile = scripts / PrintHello.scala - >脚本文件夹是否属于项目的一部分?

时间:2010-04-28 10:02:10

标签: scala maven

Maven Scala:我使用原型创建了一个scala项目:

mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create \
    -DarchetypeGroupId=org.scala-tools.archetypes \
    -DarchetypeArtifactId=scala-archetype-simple \
    -DarchetypeVersion=1.1 \
    -DremoteRepositories=http://scala-tools.org/repo-releases \
    -DgroupId=your.proj.gid -DartifactId=your-proj-id

现在,我想使用以下命令运行脚本文件:

mvn scala:script as described here mvn scala:script \
    -DscriptFile=scripts/PrintHello.scala \
    http://scala-tools.org/mvnsites/maven-scala-plugin/usage_script.html

知道在哪里放我的.Scala文件? “脚本/”究竟指的是什么?

THX

1 个答案:

答案 0 :(得分:0)

scripts /是与pom.xml位于同一级别的目录。那是......

/myproject
  pom.xml
  /scripts
    hello.scala

因此,在与pom.xml相同的目录中,尝试...

>mkdir scripts
>echo 'println("hello")' >> scripts/hello.scala
>mvn scala:script -DscriptFile=bob/hello.scala