- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Re: [maven-and-scala] Re: Scala compiler plugins and Eclipse workspace resolution
Mon, 2009-06-29, 22:20
Ah, my first email may have been slightly uninformed. There is no integration between maven-scala-plugin's "scalac plugin" feature and the eclipse plugin's scalac plugin features. This is a great idea to integrate the two. Eclipse provides support for scalac plugins, however you must know where they reside and it will not use the ones resolved from maven.
In terms of using the plugin to compile code and make sure it works, I tend to use the maven-shitty-plugin (or maven-invoker-plugin) to run sub-projects which make use of the scalac plugin. The Eclipse support for this isn't quite as nice yet.
- Josh
On Mon, Jun 29, 2009 at 4:51 PM, Erkki Lindpere <villane@gmail.com> wrote:
In terms of using the plugin to compile code and make sure it works, I tend to use the maven-shitty-plugin (or maven-invoker-plugin) to run sub-projects which make use of the scalac plugin. The Eclipse support for this isn't quite as nice yet.
- Josh
On Mon, Jun 29, 2009 at 4:51 PM, Erkki Lindpere <villane@gmail.com> wrote:
BTW, I forgot to say this is an awesome feature (specifying plug-ins
in POM and resolving them)! Takes a load of explaining how to use off
my hands if I want to provide a compiler plug-in with my library!
Could it also be configured to use the compiler plug-in to compile
it's own tests residing in the same Maven project? In other words, a
single project, the plug-in itself compiles normally, but it's tests
compile with the plug-in itself enabled.
On Jun 29, 4:52 am, Josh Suereth <joshua.suer...@gmail.com> wrote:
> I actually think this is a bug in how the Scala IDE for Eclipse is handling
> classpath resolution. I would check to see if this already exists in trac
> (The Plugin not handling project dependencies in the classpath), as this may
> have been fixed. What version of the Eclipse plugin are you using?
>
> On Sun, Jun 28, 2009 at 8:18 PM, Erkki Lindpere <vill...@gmail.com> wrote:
>
> > Sorry if this is the wrong place to report: I don't know enough about
> > Maven's internals to know if this is more of an issue for m2eclipse,
> > maven or maven-scala-plugin.
>
> > When using a scala compiler plugin described in the POM, and both the
> > project being built and the scala compiler plug-in are in the same
> > Eclipse workspace, and M2Eclipse is doing workspace resolution, I get
> > the following error when M2Eclipse is doing building.
>
> > It seems the Maven-scala-plugin assumes the resolved plug-in is a jar,
> > but it's actually a folder.
>
> > 29.06.09 3:12:26 EEST: [WARN] Exception in thread "main"
> > java.io.FileNotFoundException: \path-to-plugin-project-in-workspace
> > \target\classes (Access is denied)
> > 29.06.09 3:12:26 EEST: [WARN] at java.util.zip.ZipFile.open(Native
> > Method)
> > 29.06.09 3:12:26 EEST: [WARN] at java.util.zip.ZipFile.<init>
> > (ZipFile.java:114)
> > 29.06.09 3:12:26 EEST: [WARN] at java.util.jar.JarFile.<init>
> > (JarFile.java:133)
> > 29.06.09 3:12:26 EEST: [WARN] at java.util.jar.JarFile.<init>
> > (JarFile.java:97)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.tools.nsc.plugins.Plugin$.scala
> > $tools$nsc$plugins$Plugin$$loadDescription(Plugin.scala:81)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.tools.nsc.plugins.Plugin
> > $.loadFrom(Plugin.scala:106)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.tools.nsc.plugins.Plugin$
> > $anonfun$loadAllFrom$5.apply(Plugin.scala:142)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.tools.nsc.plugins.Plugin$
> > $anonfun$loadAllFrom$5.apply(Plugin.scala:142)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.List.map(List.scala:812)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.tools.nsc.plugins.Plugin
> > $.loadAllFrom(Plugin.scala:142)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.tools.nsc.plugins.Plugins
> > $class.loadRoughPluginsList(Plugins.scala:28)
> > 29.06.09 3:12:26 EEST: [WARN] at
> > scala.tools.nsc.Global.loadRoughPluginsList(Global.scala:34)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.tools.nsc.plugins.Plugins
> > $class.roughPluginsList(Plugins.scala:38)
> > 29.06.09 3:12:26 EEST: [WARN] at
> > scala.tools.nsc.Global.roughPluginsList(Global.scala:34)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.tools.nsc.plugins.Plugins
> > $class.loadPlugins(Plugins.scala:91)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.tools.nsc.Global.loadPlugins
> > (Global.scala:34)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.tools.nsc.plugins.Plugins
> > $class.plugins(Plugins.scala:123)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.tools.nsc.Global.plugins
> > (Global.scala:34)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.tools.nsc.plugins.Plugins
> > $class.computePhaseDescriptors(Plugins.scala:155)
> > 29.06.09 3:12:26 EEST: [WARN] at
> > scala.tools.nsc.Global.computePhaseDescriptors(Global.scala:34)
> > 29.06.09 3:12:26 EEST: [WARN] at
> > scala.tools.nsc.Global.phaseDescriptors(Global.scala:442)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.tools.nsc.Global$Run.<init>
> > (Global.scala:490)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.tools.nsc.Main$.process
> > (Main.scala:72)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.tools.nsc.Main$.main
> > (Main.scala:87)
> > 29.06.09 3:12:26 EEST: [WARN] at scala.tools.nsc.Main.main(Main.scala)
Your e-mail was not uninformed at all. I meant m2eclipse running Maven
from inside Eclipse to compile.
Erkki
Josh Suereth wrote:
> Ah, my first email may have been slightly uninformed. There is no
> integration between maven-scala-plugin's "scalac plugin" feature and
> the eclipse plugin's scalac plugin features. This is a great idea to
> integrate the two. Eclipse provides support for scalac plugins,
> however you must know where they reside and it will not use the ones
> resolved from maven.
>