This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: Mvn recompiles everything

5 replies
Naftoli Gugenheim
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.

Where in the POM does that go?
I'm not on 2.8

-------------------------------------
Andrew Gaydenko wrote:

On Sunday 10 January 2010 07:24:50 Naftoli Gugenheim wrote:
> Is there a way to have maven not recompile everything?
>

Here [1] Caoyuan describes setup for NetBeans, but, as you can see, maven-
related config itself is not related to NB. Key config place:

-target:jvm-1.5
-make:transitivenocp
-dependencyfile
${project.build.directory}/.scala_dependencies

[1] http://blogtrader.net/blog/how_to_setup_dependencies_aware2

P.S. The question is more appropriate to scala-tools mailing list.

Andrew

anli
Joined: 2008-08-19,
User offline. Last seen 1 day 1 hour ago.
Re: Re: Mvn recompiles everything

On Sunday 10 January 2010 07:44:27 Naftoli Gugenheim wrote:
> Where in the POM does that go?
> I'm not on 2.8

-make:transitivenocp scalac option exists since 2.8.

Naftoli Gugenheim
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Mvn recompiles everything

I'm not using scalac, I'm using maven. Until recently it compiled files that needed to be compiled; now it compiles all files.

-------------------------------------
Andrew Gaydenko wrote:

On Sunday 10 January 2010 07:44:27 Naftoli Gugenheim wrote:
> Where in the POM does that go?
> I'm not on 2.8

-make:transitivenocp scalac option exists since 2.8.

Naftoli Gugenheim
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Mvn recompiles everything

I'd rather do a manual clean when I update a dependency of another file, than have the equivalent of clean (timewise) forced on me every time I tweak something.

-------------------------------------
Andrew Gaydenko wrote:

On Sunday 10 January 2010 09:06:26 Brian Maso wrote:
> Probably should ask on scala-tools, but since applies to many a scala
> project...
>
> Looking at the scala maven plugin source [1], it seems right now the
> compile mojo *always* recompiles everything (?!) -- see the
> "recompileMode" private member is set to "ALL" by default, and there is no
> mutator method for this member. Seems that if there was a way to set this
> member to he value "MODIFIED_ONLY",

It woud be incorrect recompiling. To recompile needed only (but *all* needed)
project's files -make:transitive[nocp] scalac option must be used, as decribed
[1] for ant use case and [2] for maven use case.

I have read many positive words about SBT [3] which also has dependency-aware
compilation (didn't use it myself yet, as far as NB+maven environment
satisfies my needs).

[1] http://blogtrader.net/blog/how_to_setup_dependencies_aware
[2] http://blogtrader.net/blog/how_to_setup_dependencies_aware2
[3] http://code.google.com/p/simple-build-tool/

Andrew

> then you could get partial
> recompilation. Doesn't appear to be an option in the current version of
> the plugin though.
>
> Best regards,
> Brian Maso
> (949) 395-8551
> brian [at] blumenfeld-maso [dot] com
> twitter: @bmaso
> skype: brian.maso
> LinkedIn: http://www.linkedin.com/in/brianmaso
>
> [1]
> http://github.com/davidB/maven-scala-plugin/blob/master/src/main/java/org_s
> cala_tools_maven/ScalaCompilerSupport.java
>
> On Sat, Jan 9, 2010 at 8:24 PM, Naftoli Gugenheim
wrote:
> > Is there a way to have maven not recompile everything?
>

david.bernard
Joined: 2009-01-08,
User offline. Last seen 1 year 27 weeks ago.
Re: Re: Mvn recompiles everything

Since version 2.13 of maven-scala-plugin, every files are recompiled
by default :
* recompiling only modified file could introduce lot of issue
(modification of trait / implicit => recompile class who use it, a
scala file could have several class, and some could be extracted,...)
* lot of users always do a "clean compile" to be sure to "avoid" those issue
* users of cc have potential "wrong" result
* allow to better integration with Eclipse (yascaladt plugin use it to
mark error in every files)

The previous behaviour is available if you need it :
* from command line : -Drecompilation-mode=modify-only
* or in pom.xml : modify-only

Future version of the maven-scala-plugin should improve compilation
time. (integration of a custom scalac-server and may-be usage of sbt
dependency feaure)

the scala-tools or the maven-and-scala
(http://groups.google.com/group/maven-and-scala) mailing-list are
better place.

/davidB

On Sun, Jan 10, 2010 at 07:27, Naftoli Gugenheim wrote:
> I'd rather do a manual clean when I update a dependency of another file, than have the equivalent of clean (timewise) forced on me every time I tweak something.
>
> -------------------------------------
> Andrew Gaydenko wrote:
>
> On Sunday 10 January 2010 09:06:26 Brian Maso wrote:
>> Probably should ask on scala-tools, but since applies to many a scala
>> project...
>>
>> Looking at the scala maven plugin source [1], it seems right now the
>>  compile mojo *always* recompiles everything (?!) -- see the
>>  "recompileMode" private member is set to "ALL" by default, and there is no
>>  mutator method for this member. Seems that if there was a way to set this
>>  member to he value "MODIFIED_ONLY",
>
> It woud be incorrect recompiling. To recompile needed only (but *all* needed)
> project's files -make:transitive[nocp] scalac option must be used, as decribed
> [1] for ant use case and [2] for maven use case.
>
> I have read many positive words about SBT [3] which also has dependency-aware
> compilation (didn't use it myself yet, as far as NB+maven environment
> satisfies my needs).
>
> [1]
http://blogtrader.net/blog/how_to_setup_dependencies_aware
> [2] http://blogtrader.net/blog/how_to_setup_dependencies_aware2
> [3] http://code.google.com/p/simple-build-tool/
>
>
> Andrew
>
>>  then you could get partial
>>  recompilation. Doesn't appear to be an option in the current version of
>>  the plugin though.
>>
>> Best regards,
>> Brian Maso
>> (949) 395-8551
>> brian [at] blumenfeld-maso [dot] com
>> twitter: @bmaso
>> skype: brian.maso
>> LinkedIn: http://www.linkedin.com/in/brianmaso
>>
>> [1]
>> http://github.com/davidB/maven-scala-plugin/blob/master/src/main/java/org_s
>> cala_tools_maven/ScalaCompilerSupport.java
>>
>> On Sat, Jan 9, 2010 at 8:24 PM, Naftoli Gugenheim
> wrote:
>> > Is there a way to have maven not recompile everything?
>>
>

david.bernard
Joined: 2009-01-08,
User offline. Last seen 1 year 27 weeks ago.
Re: Re: Mvn recompiles everything

Since version 2.13 of maven-scala-plugin, every files are recompiled
by default :
* recompiling only modified file could introduce lot of issue
(modification of trait / implicit => recompile class who use it, a
scala file could have several class, and some could be extracted,...)
* lot of users always do a "clean compile" to be sure to "avoid" those issue
* users of cc have potential "wrong" result
* allow to better integration with Eclipse (yascaladt plugin use it to
mark error in every files)

The previous behaviour is available if you need it :
* from command line : -Drecompilation-mode=modify-only
* or in pom.xml : modify-only

Future version of the maven-scala-plugin should improve compilation
time. (integration of a custom scalac-server and may-be usage of sbt
dependency feaure)

the scala-tools or the maven-and-scala
(http://groups.google.com/group/maven-and-scala) mailing-list are
better place.

/davidB

On Sun, Jan 10, 2010 at 07:27, Naftoli Gugenheim wrote:
> I'd rather do a manual clean when I update a dependency of another file, than have the equivalent of clean (timewise) forced on me every time I tweak something.
>
> -------------------------------------
> Andrew Gaydenko wrote:
>
> On Sunday 10 January 2010 09:06:26 Brian Maso wrote:
>> Probably should ask on scala-tools, but since applies to many a scala
>> project...
>>
>> Looking at the scala maven plugin source [1], it seems right now the
>>  compile mojo *always* recompiles everything (?!) -- see the
>>  "recompileMode" private member is set to "ALL" by default, and there is no
>>  mutator method for this member. Seems that if there was a way to set this
>>  member to he value "MODIFIED_ONLY",
>
> It woud be incorrect recompiling. To recompile needed only (but *all* needed)
> project's files -make:transitive[nocp] scalac option must be used, as decribed
> [1] for ant use case and [2] for maven use case.
>
> I have read many positive words about SBT [3] which also has dependency-aware
> compilation (didn't use it myself yet, as far as NB+maven environment
> satisfies my needs).
>
> [1]
http://blogtrader.net/blog/how_to_setup_dependencies_aware
> [2] http://blogtrader.net/blog/how_to_setup_dependencies_aware2
> [3] http://code.google.com/p/simple-build-tool/
>
>
> Andrew
>
>>  then you could get partial
>>  recompilation. Doesn't appear to be an option in the current version of
>>  the plugin though.
>>
>> Best regards,
>> Brian Maso
>> (949) 395-8551
>> brian [at] blumenfeld-maso [dot] com
>> twitter: @bmaso
>> skype: brian.maso
>> LinkedIn: http://www.linkedin.com/in/brianmaso
>>
>> [1]
>> http://github.com/davidB/maven-scala-plugin/blob/master/src/main/java/org_s
>> cala_tools_maven/ScalaCompilerSupport.java
>>
>> On Sat, Jan 9, 2010 at 8:24 PM, Naftoli Gugenheim
> wrote:
>> > Is there a way to have maven not recompile everything?
>>
>

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland