Scala ant构建错误

时间:2017-01-31 13:06:27

标签: scala playframework ant

我有一个Scala项目,我正在编写build.xml来使用ant构建它。我在我的ubuntu环境中使用play 1.2.7和scala-2.10.4。 Follwoing是我的build.xml

        用于在DIT上构建JBoss 5.0.1的Ipp Partner应用程序的Ant文件                                                                           

<!-- release build settings -->
<property name="dist.dir" value="${java.io.tmpdir}/dist"/>
<property name="partner.dist.template" value="deployment/partner-domain"/>
<property name="partner.war.dir" value="${build.dir}/partner/partner.war"/>
<property name="partner.sql.dir.source" value="sql"/>
<property name="partner.sql.dir.migrations" value="${partner.sql.dir.source}/migrations"/>
<property name="partner.docs.dir.source" value="documentation"/>
<property name="partner.sql.dir.dest" value="${dist.dir}/resources/sql"/>
<property name="partner.sql.dir.dest.migrations" value="${dist.dir}/resources/sql/migrations"/>
<property name="partner.docs.dir.dest" value="${dist.dir}/docs"/>
<property name="partner.translations.dir.dest" value="${dist.dir}/resources/translations/"/>
<property name="partner.doc.dir" value="documentation"/>
<property name="dist.partner.war.dir" value="${dist.dir}/applications/partner.ear/partner.war"/>
<property name="lib" value="lib"/>
<tstamp>
    <format property="dist.time" pattern="yyyy-MM-dd-HHmm"/>
</tstamp>


<target name="init">
    <property
    name="scala-library.jar"
    value="${env.SCALA_HOME}/lib/scala-library.jar"
     />
    <path id="build.classpath">
        <pathelement location="${lib}/anorm_2.10-2.3.1.jar"/>
        <pathelement location="${lib}/bootstrap-3.2.0.jar"/>
        <pathelement location="${lib}/jbcrypt-0.3m.jar"/>
        <pathelement location="${lib}/play-1.2.7.jar"/>
        <pathelement location="${lib}/play-ws_2.10-2.3.1.jar"/>
        <pathelement location="${lib}/webjars-play_2.10-2.3.0.jar"/>
        <pathelement location="${lib}/sbt-plugin-2.3.1.jar"/>



        <fileset dir="${env.PLAY_HOME}/framework">
            <include name="*.jar"/>
        </fileset>
        <fileset dir="${env.PLAY_HOME}/framework/lib">
            <include name="*.jar"/>
        </fileset>
        <fileset dir="lib">
            <include name="*.jar"/>
        </fileset>
        <fileset dir="${env.PLAY_HOME}/modules/scala-0.9/lib">
            <include name="*.jar"/>
        </fileset>

        <pathelement location="${scala-library.jar}"   />
        <pathelement location="${env.PLAY_HOME}/framework/play-1.2.7.jar"/>
        <!--<pathelement location="${your.path}"   />-->
        <pathelement location="${build.dir}"   />
    </path>
    <taskdef resource="scala/tools/ant/antlib.xml">
        <classpath>
            <pathelement location="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
            <pathelement location="${env.SCALA_HOME}/lib/scala-reflect.jar"/>
            <pathelement location="${scala-library.jar}"/>
            <pathelement location="${env.PLAY_HOME}/framework/play-1.2.7.jar"/>




            <pathelement location="${lib}/anorm_2.10-2.3.1.jar"/>
            <pathelement location="${lib}/bootstrap-3.2.0.jar"/>
            <pathelement location="${lib}/jbcrypt-0.3m.jar"/>
            <pathelement location="${lib}/play-1.2.7.jar"/>
            <pathelement location="${lib}/play-ws_2.10-2.3.1.jar"/>
            <pathelement location="${lib}/webjars-play_2.10-2.3.0.jar"/>
            <pathelement location="${lib}/sbt-plugin-2.3.1.jar"/>

        </classpath>
    </taskdef>
</target>

<target name="build" depends="init">
    <mkdir dir="${build.dir}"/>
    <echo>build.dir:  ${build.dir}</echo>
    <scalac srcdir="/home/vf-root/workspaces/partnerspace/ipp-partner"
            destdir="${build.dir}"
            classpathref="build.classpath">
    </scalac>
</target>

以下是我在scala文件中的导入:

import play.api._
import models._
import anorm._
import play.api.mvc.Filter
import play.api.mvc.RequestHeader
import play.api.mvc.Result
import scala.concurrent.Future
import play.api.mvc.SimpleResult
import play.api.mvc.WithFilters
import play.Configuration
import filter.UrlRewritingFilter
import play.api.libs.Crypto

构建后,我收到以下错误消息:

[scalac] Compiling 49 scala and 2 java source files to /tmp/build
   [scalac] /home/vf-root/workspaces/partnerspace/ipp-partner/app/Global.scala:4: error: object mvc is not a member of package play.api
   [scalac] import play.api.mvc.Filter
   [scalac]                 ^
   [scalac] /home/vf-root/workspaces/partnerspace/ipp-partner/app/Global.scala:5: error: object mvc is not a member of package play.api
   [scalac] import play.api.mvc.RequestHeader
   [scalac]                 ^
   [scalac] /home/vf-root/workspaces/partnerspace/ipp-partner/app/Global.scala:6: error: object mvc is not a member of package play.api
   [scalac] import play.api.mvc.Result
   [scalac]                 ^
   [scalac] /home/vf-root/workspaces/partnerspace/ipp-partner/app/Global.scala:8: error: object mvc is not a member of package play.api
   [scalac] import play.api.mvc.SimpleResult
   [scalac]                 ^
   [scalac] /home/vf-root/workspaces/partnerspace/ipp-partner/app/Global.scala:9: error: object mvc is not a member of package play.api
   [scalac] import play.api.mvc.WithFilters
   [scalac]                 ^
   [scalac] /home/vf-root/workspaces/partnerspace/ipp-partner/app/Global.scala:10: error: object Configuration is not a member of package play
   [scalac] import play.Configuration
   [scalac]        ^
   [scalac] /home/vf-root/workspaces/partnerspace/ipp-partner/app/Global.scala:12: error: object Crypto is not a member of package play.api.libs
   [scalac] import play.api.libs.Crypto
   [scalac]        ^

任何人都可以指导我如何解决这些问题。我已经在类路径中添加了播放依赖项,但仍然是为什么我会收到这些播放错误?

0 个答案:

没有答案