Re: [sbt] [sbt-aspectj] How configure aspectj compilation using spring-aspects dependency

574 views
Skip to first unread message

Peter Vlugter

unread,
May 16, 2013, 9:48:11 PM5/16/13
to simple-b...@googlegroups.com
Hi there,

The sample project you linked to shows how to use a library dependency as an aspectj binary by finding it in the update report.

You want something like:

libraryDependencies += "org.springframework" % "spring-aspects" % "3.1.4.RELEASE",
binaries in Aspectj <++= update map { report =>
report.matching(moduleFilter(organization = "org.springframework", name = "spring-aspects"))
}

To use the aspectj outputs in place of the regular compile and runtime products, use:

products in Compile <<= products in Aspectj,
products in Runtime <<= products in Compile

Cheers,
Peter

On 17/05/2013, at 8:50 AM, amertum <ame...@gmail.com> wrote:

> I would like to enable aspectj compilation of my project classes using the already compiled spring-aspects
>
> I am integrating the sbt-aspectj plugin within a playframework 2.1 java project
>
> val main = play.Project(appName, appVersion, appDependencies)
> .settings(aspectjSettings: _*)
> .settings(
> verbose in Aspectj := true,
> showWeaveInfo in Aspectj := true,
> inputs in Aspectj <+= compiledClasses,
> binaries in Aspectj += file("/home/user/.m2/repository/org/springframework/spring-aspects/3.1.4.RELEASE/spring-aspects-3.1.4.RELEASE.jar")
> )
>
> but the weaving don't appear to append and I would like to use another way to define the spring-aspects jar using dependencies such as :
>
> libraryDependencies += "org.springframework" % "spring-aspects" % "3.1.4.RELEASE",
>
> I looked at this example https://github.com/sbt/sbt-aspectj/tree/v0.9.0/src/sbt-test/weave/external but it is for weaving of external module, not dependencies.
>
> Help would be really appreciated as I am a newbie with sbt and very confused by its logic (come from maven world...).
>
> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-t...@googlegroups.com.
> To post to this group, send email to simple-b...@googlegroups.com.
> Visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

amertum

unread,
May 17, 2013, 5:41:19 AM5/17/13
to simple-b...@googlegroups.com
You're right. You make my day.
Reply all
Reply to author
Forward
0 new messages