标签: sbt-aspectj

在SBT中使用Spring-Data-Neo4j高级映射模式

我想在我的Scala SBT项目中使用spring-data-neo4j 的高级映射模式(托管在github上):

我可以使用存储库将节点存储在数据库中,但我不能进行aspectj-weaving工作.

这是我到目前为止:

build.sbt:

resolvers ++= Seq(
  "spring" at "http://repo.spring.io/milestone",
  "neo4j-releases" at "http://m2.neo4j.org/releases/"
)

libraryDependencies ++= Seq(
  "org.springframework.data" % "spring-data-neo4j"         % "3.0.0.M1"      % "compile",
  "org.springframework.data" % "spring-data-neo4j-aspects" % "3.0.0.M1"      % "compile",
  "javax.persistence"        % "persistence-api"           % "1.0"           % "compile",
  "javax.validation"         % "validation-api"            % "1.0.0.GA"      % "compile",
  "junit"                    % "junit"                     % "4.11"          % "test",
  "com.novocode"             % "junit-interface"           % "0.9"           % "test",
  "org.springframework"      % "spring-test"               % "4.0.0.RELEASE" % "test"
)


Seq(aspectjSettings: _*)

verbose in Aspectj := false …
Run Code Online (Sandbox Code Playgroud)

scala aspectj sbt spring-data-neo4j sbt-aspectj

5
推荐指数
1
解决办法
629
查看次数

你如何开发SBT项目呢?

背景:我有一个Play 2.0项目,我正在尝试在我的一些类(Java)中使用jar中的方面添加一些东西来进行aspectj编织.(sbt-aspectj似乎没有这样做,或者我看不出怎么样).所以我需要添加一个自定义任务,并依赖于编译.我有点想出了依赖部分.但是,因为我不确切知道我在做什么,但是,我想使用IDE开发它(我使用的是Scala-IDE).由于sbt项目(以及Play项目)是递归定义的,我假设我可以:

  1. 将eclipse插件添加到myplay/project/project/plugins.sbt
  2. 将sbt main jar(和aspectj jar)添加到myplay/project/project/build.sbt:

    libraryDependencies ++ = Seq("org.scala-sbt"%"main"%"0.12.2","aspectj"%"aspectj-tools"%"1.0.6")

  3. 放入myplay /项目

  4. 运行sbt,运行eclipse任务,然后将项目作为单独的项目导入eclipse.

我可以做到这一点,虽然build.scala(和其他scala文件)最初不被认为是源代码,我必须稍微改进构建路径.但是,即使我已经为项目定义了sbt main,eclipse IDE和编译任务都会产生错误:

> compile
[error] .../myplay/project/Build.scala:2: not found: object keys
[error] import keys.Keys._
[error]        ^
[error] .../myplay/project/SbtAspectJ.scala:2: object Configurations is not a member of package sbt
[error] import sbt.Configurations.Compile
[error]            ^
[error] .../myplay/project/SbtAspectJ.scala:3: object Keys is not a member of package sbt
[error] import sbt.Keys._
[error]            ^
[error] three errors found
Run Code Online (Sandbox Code Playgroud)

eclipse项目在其引用库中既没有显示主要工具也没有方面工具.但是,如果我给它一个虚假的版本(例如0.12.4),重新加载失败,所以它似乎使用依赖.

所以,......首先:这是正确的方法吗?第二:如果是这样,为什么不添加库.(第三:请不要让我感到愚蠢,我错过了.)

sbt scala-ide sbt-aspectj

3
推荐指数
1
解决办法
857
查看次数

标签 统计

sbt ×2

sbt-aspectj ×2

aspectj ×1

scala ×1

scala-ide ×1

spring-data-neo4j ×1