Hi there,
I'm trying, once and for all to get my Scala builds working correctly
with Maven. I've been copying-n-pasting from various sources for the
last year or so. But I thought it was about time I sorted out a
definitive configuration.
I've created a git project (at Bitbucket), comprising a pom project
and two jar modules.
The first module is structured in such a way that the Scala code
depends upon the Java code.
https://bitbucket.org/sentimental/idea_mvn_mixed_java_scala/src/05abab836b0a/java_then_scala/pom.xml
The second module is structured in such a way that the Java code
depends upon the Scala code.
https://bitbucket.org/sentimental/idea_mvn_mixed_java_scala/src/05abab836b0a/scala_then_java/pom.xml
It works as is, but I noticed that the Java code is being compiled
twice when run at the command line. Does anyone have any suggestion as
to why this?
<excludes>
<exclude>*.java</exclude>
</excludes>
The Scala console task works great. I didn't even know that feature
existed for Maven. I thought it was only something that could be done
with SBT (which I don't have the time to deal with).
Hi David, my observation was based upon the following output.
Firstly establish what is on the src path.
print -C1 java_then_scala/**/*.(java|scala)
java_then_scala/src/main/java/Hello.java
java_then_scala/src/main/java/IncludeInJarPlease.java
java_then_scala/src/main/scala/World.scala
I observed that the maven-scala-plugin indicated it was compiling 3
source files, meanwhile the maven-compiler-plugin indicated that it was
compiling 3 files.
Here is the (trimmed) Maven output:
------------------------------------------------------------------------
Building java_then_scala 1.0-SNAPSHOT
------------------------------------------------------------------------
maven-scala-plugin:2.15.2:compile (project-resources-execution) @ java_then_scala
Checking for multiple versions of scala
includes = [**/*.scala,**/*.java,]
excludes = []
/common/idea_mvn_mixed_java_scala/java_then_scala/src/main/java:-1: info: compiling
/common/idea_mvn_mixed_java_scala/java_then_scala/src/main/scala:-1: info: compiling
Compiling 3 source files to /common/idea_mvn_mixed_java_scala/java_then_scala/target/classes at 1329840782560
prepare-compile in 0 s
compile in 13 s
--- maven-compiler-plugin:2.3.2:compile (default-compile) @ java_then_scala ---
Compiling 2 source files to /common/idea_mvn_mixed_java_scala/java_then_scala/target/classes
--- maven-scala-plugin:2.15.2:compile (compile) @ java_then_scala ---
Checking for multiple versions of scala
includes = [**/*.scala,**/*.java,]
excludes = []
On Wed, 22 Feb 2012 09:16:47 -0500, Josh Suereth <joshua....@gmail.com> wrote:
Non-text part: multipart/alternative
> It looks like you the scala:compile mojo is being added to two
> executions... Could the default be doing this?
I'm not sure I follow, could you elaborate please?
Bryan
I'm not sure I follow, could you elaborate please?
Bryan
--
Can you provide the link of the two files ?
> --
>
>
>
Thoses files are buggy and outdated. Had you take a look at
* http://davidb.github.com/scala-maven-plugin/example_java.html
* http://davidb.github.com/scala-maven-plugin/example_incremental.html#Mixed_Scala_and_Java_Sources
?
--
--
---
You received this message because you are subscribed to a topic in the Google Groups "Maven and Scala" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/maven-and-scala/L1r4D_L_7SY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to maven-and-sca...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.