You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by I am Who i am <ra...@gmail.com> on 2007/10/10 20:45:44 UTC

How to do incremental build?

Hi All

How do i enable incremental build with maven2 and continuum?

Re: How to do incremental build?

Posted by Steve Ebersole <st...@hibernate.org>.
This is an idea that JBoss and myself, personally, have brought up with the 
Maven team quite a few times.  The terms we use is that of a binary (repo) 
dependency versus a source (module) dependency.  Another name for 'source 
dependency' might be 'local dependency'.  Whatever its term, I personally 
really see benefit in this when a project is modularized as an implement 
detail as opposed to any desire to have seperate release cycles to the 
modules.  For example, in the mavenization of Hibernate I chose to "break 
out" modules to better isolate dependencies.  I have no intention that the 
modules be versioned separately, or really even developed separately.  When I 
make a change in module, I want modules which depend in it to see that change 
just like when I operate within IntelliJ (and probably all other IDEs, I 
would assume).


On Monday 03 December 2007 05:09:48 am Dimitris Kapanidis wrote:
> I agree,
>
> When I started using maven with multi-module projects, intuively when
> doing mvn package in a module I was supposing that local changes of
> other modules will be used to test the local changes of the tested module.
>
> A possible solution that I can see would be to have an mvn parameter to
> trigger a classpath of the local modules, instead of the repository ones.
>
> for example (the name is just an example):
>
> $ mvn --help
> -lc --local-classpath Use local classpath instead of repository.
>
> if there is the following module structure:
> /pom.xml (root pom)
> /moduleA/pom.xml (changed module)
> /moduleB/pom.xml (changed module)
> /moduleC/pom.xml (unchanged module)
>
> the following command:
> /moduleA/$ mvn test
> should be testing moduleA with the last installed "moduleB" and "moduleC".
>
> and the following command
> /moduleA/$ mvn -lc test
> should be testing moduleA with a classpath similar to
> src/main/test:src/main/java:../moduleA/src/main/test/:
>
> I'd like some comments about if this is possible/desirable or not.


-- 
Steve Ebersole

Hibernate Project Lead
http://hibernate.org

Principal Software Engineer
http://redhat.com
http://jboss.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to do incremental build?

Posted by Stephen Connolly <st...@gmail.com>.
On Dec 3, 2007 10:24 AM, Saloucious <sa...@gmail.com> wrote:
> But it's not able to see affected files from modules which depend on
> modified one, as Eclipse do.

Eclipse gets this by scanning the java files to identify dependencies
(for code complete, etc) and when it does it's background compilation.

Essentially, Eclipse has done a lot of work in the background and
built a dependency tree for each class.  It would most likely take
Maven just as long to figure out the dependencies as to do a clean
compile unless maven were to persist the results of a dependency
analysis into the target folder...

Of course that would make the normal compiles slower...

If you are running a CI server in the background
(http://hudson.dev.java.net/ anyone?) then the compile time is less of
an issue for Maven builds.

If you are looking to take the changes quickly while developing, your
IDE will have recompiled the necessary files anyway, so what is the
problem with Maven's method of compiling only newer .java files...
there should be none of them as your IDE will have compiled them, all
you are using Maven for in that case is the packaging of artifacts
(which your IDE will do for you anyway... and you're only doing a
Maven build as a pre-test to commiting your changes... oh so in that
case you _should_ be doing a clean install not an incremental)

Just my €0.02

-Stephen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to do incremental build?

Posted by Dimitris Kapanidis <di...@itconsulting.gr>.
I agree,

When I started using maven with multi-module projects, intuively when 
doing mvn package in a module I was supposing that local changes of 
other modules will be used to test the local changes of the tested module.

A possible solution that I can see would be to have an mvn parameter to 
trigger a classpath of the local modules, instead of the repository ones.

for example (the name is just an example):

$ mvn --help
-lc --local-classpath Use local classpath instead of repository.

if there is the following module structure:
/pom.xml (root pom)
/moduleA/pom.xml (changed module)
/moduleB/pom.xml (changed module)
/moduleC/pom.xml (unchanged module)

the following command:
/moduleA/$ mvn test
should be testing moduleA with the last installed "moduleB" and "moduleC".

and the following command
/moduleA/$ mvn -lc test
should be testing moduleA with a classpath similar to 
src/main/test:src/main/java:../moduleA/src/main/test/:

I'd like some comments about if this is possible/desirable or not.

Saloucious wrote:
> May be I have to rectify what i would like to ask : 
>
> How to make incremental build between multi-modules.
>
> As far as I know : 
>
> An incremental build reuses the results of a previous build to perform an
> optimized build based on the changes since the last build.
>
> With M2, don't see where optimizations are between modules
>
> When an incremental build is triggered, the builder selectively recompiles
> the added, changed, or otherwise affected .java files that are described in
> the resource delta and updates the problem markers as necessary. Any .class
> files or markers that are no longer appropriate are removed.
>
> Sure M2 (without clean) reuses previous build state to says : 
> Nothing to compile - all classes are up to date
> or create a resource change delta if modification has been detected inside a
> module
>
> But it's not able to see affected files from modules which depend on
> modified one, as Eclipse do.
>
>
>
> Siarhei wrote:
>   
>> Why would you recompile a module which didn't change? Java doesn't need to
>> re-link (is that what you think?) when dependent code has changed for as
>> long as API stays the same (and if that is changed it wont compile of
>> course
>> :)
>>
>> Without getting in too much details - by not calling 'clean' goal your
>> build
>> will be incremental
>>
>> On 11/30/07, Saloucious <sa...@gmail.com> wrote:
>>     
>>> I don't think Maven will recompile modules which depends of modified one
>>>
>>> Is maven can make incremental builds ?
>>>
>>>
>>> http://www.javaworld.com/javaforums/showflat.php?Cat=0&Number=32334&Main=32334
>>>
>>> http://www.javaworld.com/javaforums/showflat.php?Cat=0&Number=32334&Main=32334
>>>
>>>
>>>
>>>
>>> Andrew Boyer wrote:
>>>       
>>>> Incremental builds can be done by not calling the clean target.  In
>>>> continuum, I believe the default targets are 'clean install'.  If you
>>>> change that to just 'install', you'll be doing incrementals.
>>>>
>>>> I haven't tried this, but it should work, since continuum maintains one
>>>> working directory per project, and re-uses that working directory each
>>>> time it does a build.
>>>>
>>>> Andrew
>>>>
>>>>         
>>>>> -----Original Message-----
>>>>> From: I am Who i am [mailto:ragjan@gmail.com]
>>>>> Sent: Wednesday, October 10, 2007 2:46 PM
>>>>> To: users@maven.apache.org
>>>>> Subject: How to do incremental build?
>>>>>
>>>>> Hi All
>>>>>
>>>>> How do i enable incremental build with maven2 and continuum?
>>>>>           
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>>
>>>>         
>>> --
>>> View this message in context:
>>> http://www.nabble.com/How-to-do-incremental-build--tf4602698s177.html#a14087762
>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>       
>>     
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to do incremental build?

Posted by Saloucious <sa...@gmail.com>.
May be I have to rectify what i would like to ask : 

How to make incremental build between multi-modules.

As far as I know : 

An incremental build reuses the results of a previous build to perform an
optimized build based on the changes since the last build.

With M2, don't see where optimizations are between modules

When an incremental build is triggered, the builder selectively recompiles
the added, changed, or otherwise affected .java files that are described in
the resource delta and updates the problem markers as necessary. Any .class
files or markers that are no longer appropriate are removed.

Sure M2 (without clean) reuses previous build state to says : 
Nothing to compile - all classes are up to date
or create a resource change delta if modification has been detected inside a
module

But it's not able to see affected files from modules which depend on
modified one, as Eclipse do.



Siarhei wrote:
> 
> Why would you recompile a module which didn't change? Java doesn't need to
> re-link (is that what you think?) when dependent code has changed for as
> long as API stays the same (and if that is changed it wont compile of
> course
> :)
> 
> Without getting in too much details - by not calling 'clean' goal your
> build
> will be incremental
> 
> On 11/30/07, Saloucious <sa...@gmail.com> wrote:
>>
>>
>> I don't think Maven will recompile modules which depends of modified one
>>
>> Is maven can make incremental builds ?
>>
>>
>> http://www.javaworld.com/javaforums/showflat.php?Cat=0&Number=32334&Main=32334
>>
>> http://www.javaworld.com/javaforums/showflat.php?Cat=0&Number=32334&Main=32334
>>
>>
>>
>>
>> Andrew Boyer wrote:
>> >
>> > Incremental builds can be done by not calling the clean target.  In
>> > continuum, I believe the default targets are 'clean install'.  If you
>> > change that to just 'install', you'll be doing incrementals.
>> >
>> > I haven't tried this, but it should work, since continuum maintains one
>> > working directory per project, and re-uses that working directory each
>> > time it does a build.
>> >
>> > Andrew
>> >
>> >> -----Original Message-----
>> >> From: I am Who i am [mailto:ragjan@gmail.com]
>> >> Sent: Wednesday, October 10, 2007 2:46 PM
>> >> To: users@maven.apache.org
>> >> Subject: How to do incremental build?
>> >>
>> >> Hi All
>> >>
>> >> How do i enable incremental build with maven2 and continuum?
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: users-help@maven.apache.org
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-do-incremental-build--tf4602698s177.html#a14087762
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-do-incremental-build--tf4602698s177.html#a14127262
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to do incremental build?

Posted by Siarhei Dudzin <si...@gmail.com>.
The war will be re-packaged with the new jar for as long as you run the
build form a parent module which would make sure that your new and changed
jar gets to your local repository which then gets picked up by the war
module. Note there is a difference between packaging and compiling as those
are also different phases of the build lifecycle.

On 11/30/07, Tommy@ke4kug.net <To...@ke4kug.net> wrote:
>
> What about the war (that didn't change) that depends on (and bundles)
> the jar (that did)?
>
> TK
>
> On Nov 30, 2007, at 12:20 PM, Siarhei Dudzin wrote:
>
> > Why would you recompile a module which didn't change? Java doesn't
> > need to
> > re-link (is that what you think?) when dependent code has changed
> > for as
> > long as API stays the same (and if that is changed it wont compile
> > of course
> > :)
> >
> > Without getting in too much details - by not calling 'clean' goal
> > your build
> > will be incremental
> >
> > On 11/30/07, Saloucious <sa...@gmail.com> wrote:
> >>
> >>
> >> I don't think Maven will recompile modules which depends of
> >> modified one
> >>
> >> Is maven can make incremental builds ?
> >>
> >>
> >>
> http://www.javaworld.com/javaforums/showflat.php?Cat=0&Number=32334&Main=32334
> >>
> >>
> http://www.javaworld.com/javaforums/showflat.php?Cat=0&Number=32334&Main=32334
> >>
> >>
> >>
> >>
> >> Andrew Boyer wrote:
> >>>
> >>> Incremental builds can be done by not calling the clean target.  In
> >>> continuum, I believe the default targets are 'clean install'.  If
> >>> you
> >>> change that to just 'install', you'll be doing incrementals.
> >>>
> >>> I haven't tried this, but it should work, since continuum
> >>> maintains one
> >>> working directory per project, and re-uses that working directory
> >>> each
> >>> time it does a build.
> >>>
> >>> Andrew
> >>>
> >>>> -----Original Message-----
> >>>> From: I am Who i am [mailto:ragjan@gmail.com]
> >>>> Sent: Wednesday, October 10, 2007 2:46 PM
> >>>> To: users@maven.apache.org
> >>>> Subject: How to do incremental build?
> >>>>
> >>>> Hi All
> >>>>
> >>>> How do i enable incremental build with maven2 and continuum?
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: users-help@maven.apache.org
> >>>
> >>>
> >>>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/How-to-do-incremental-build--tf4602698s177.html#a14087762
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How to do incremental build?

Posted by To...@KE4KUG.net.
What about the war (that didn't change) that depends on (and bundles)  
the jar (that did)?

TK

On Nov 30, 2007, at 12:20 PM, Siarhei Dudzin wrote:

> Why would you recompile a module which didn't change? Java doesn't  
> need to
> re-link (is that what you think?) when dependent code has changed  
> for as
> long as API stays the same (and if that is changed it wont compile  
> of course
> :)
>
> Without getting in too much details - by not calling 'clean' goal  
> your build
> will be incremental
>
> On 11/30/07, Saloucious <sa...@gmail.com> wrote:
>>
>>
>> I don't think Maven will recompile modules which depends of  
>> modified one
>>
>> Is maven can make incremental builds ?
>>
>>
>> http://www.javaworld.com/javaforums/showflat.php?Cat=0&Number=32334&Main=32334
>>
>> http://www.javaworld.com/javaforums/showflat.php?Cat=0&Number=32334&Main=32334
>>
>>
>>
>>
>> Andrew Boyer wrote:
>>>
>>> Incremental builds can be done by not calling the clean target.  In
>>> continuum, I believe the default targets are 'clean install'.  If  
>>> you
>>> change that to just 'install', you'll be doing incrementals.
>>>
>>> I haven't tried this, but it should work, since continuum  
>>> maintains one
>>> working directory per project, and re-uses that working directory  
>>> each
>>> time it does a build.
>>>
>>> Andrew
>>>
>>>> -----Original Message-----
>>>> From: I am Who i am [mailto:ragjan@gmail.com]
>>>> Sent: Wednesday, October 10, 2007 2:46 PM
>>>> To: users@maven.apache.org
>>>> Subject: How to do incremental build?
>>>>
>>>> Hi All
>>>>
>>>> How do i enable incremental build with maven2 and continuum?
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-do-incremental-build--tf4602698s177.html#a14087762
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to do incremental build?

Posted by Siarhei Dudzin <si...@gmail.com>.
Why would you recompile a module which didn't change? Java doesn't need to
re-link (is that what you think?) when dependent code has changed for as
long as API stays the same (and if that is changed it wont compile of course
:)

Without getting in too much details - by not calling 'clean' goal your build
will be incremental

On 11/30/07, Saloucious <sa...@gmail.com> wrote:
>
>
> I don't think Maven will recompile modules which depends of modified one
>
> Is maven can make incremental builds ?
>
>
> http://www.javaworld.com/javaforums/showflat.php?Cat=0&Number=32334&Main=32334
>
> http://www.javaworld.com/javaforums/showflat.php?Cat=0&Number=32334&Main=32334
>
>
>
>
> Andrew Boyer wrote:
> >
> > Incremental builds can be done by not calling the clean target.  In
> > continuum, I believe the default targets are 'clean install'.  If you
> > change that to just 'install', you'll be doing incrementals.
> >
> > I haven't tried this, but it should work, since continuum maintains one
> > working directory per project, and re-uses that working directory each
> > time it does a build.
> >
> > Andrew
> >
> >> -----Original Message-----
> >> From: I am Who i am [mailto:ragjan@gmail.com]
> >> Sent: Wednesday, October 10, 2007 2:46 PM
> >> To: users@maven.apache.org
> >> Subject: How to do incremental build?
> >>
> >> Hi All
> >>
> >> How do i enable incremental build with maven2 and continuum?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/How-to-do-incremental-build--tf4602698s177.html#a14087762
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: How to do incremental build?

Posted by Saloucious <sa...@gmail.com>.
I don't think Maven will recompile modules which depends of modified one

Is maven can make incremental builds ?

http://www.javaworld.com/javaforums/showflat.php?Cat=0&Number=32334&Main=32334
http://www.javaworld.com/javaforums/showflat.php?Cat=0&Number=32334&Main=32334 




Andrew Boyer wrote:
> 
> Incremental builds can be done by not calling the clean target.  In
> continuum, I believe the default targets are 'clean install'.  If you
> change that to just 'install', you'll be doing incrementals.
> 
> I haven't tried this, but it should work, since continuum maintains one
> working directory per project, and re-uses that working directory each
> time it does a build.
> 
> Andrew
> 
>> -----Original Message-----
>> From: I am Who i am [mailto:ragjan@gmail.com]
>> Sent: Wednesday, October 10, 2007 2:46 PM
>> To: users@maven.apache.org
>> Subject: How to do incremental build?
>> 
>> Hi All
>> 
>> How do i enable incremental build with maven2 and continuum?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-do-incremental-build--tf4602698s177.html#a14087762
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: How to do incremental build?

Posted by Andrew Boyer <ab...@Endeca.com>.
Incremental builds can be done by not calling the clean target.  In
continuum, I believe the default targets are 'clean install'.  If you
change that to just 'install', you'll be doing incrementals.

I haven't tried this, but it should work, since continuum maintains one
working directory per project, and re-uses that working directory each
time it does a build.

Andrew

> -----Original Message-----
> From: I am Who i am [mailto:ragjan@gmail.com]
> Sent: Wednesday, October 10, 2007 2:46 PM
> To: users@maven.apache.org
> Subject: How to do incremental build?
> 
> Hi All
> 
> How do i enable incremental build with maven2 and continuum?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org