All Projects → khmarbaise → incremental-module-builder

khmarbaise / incremental-module-builder

Licence: Apache-2.0 license
Incremental Module Builder

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to incremental-module-builder

gradle-git-versioning-plugin
This extension will set project version, based on current Git branch or tag.
Stars: ✭ 44 (+2.33%)
Mutual labels:  maven, maven-extension
maven-buildtime-profiler
Maven Build Time Profiler
Stars: ✭ 41 (-4.65%)
Mutual labels:  maven, maven-extension
maven-install-plugin
Apache Maven Install Plugin
Stars: ✭ 21 (-51.16%)
Mutual labels:  maven
repo.kotlin.link
Maven repository that proxy artifact request to one of know project-based maven repositories
Stars: ✭ 14 (-67.44%)
Mutual labels:  maven
design-patterns-in-java
☕ 📖 使用通俗易懂的案例,类图,及配套学习笔记来详解 Java 的二十三种设计模式 !
Stars: ✭ 35 (-18.6%)
Mutual labels:  maven
SeleniumTDD
A Selenium TDD framework that incorporates key features of Selenium and TestNG which can be used to create web-based automation scripts.
Stars: ✭ 23 (-46.51%)
Mutual labels:  maven
javadoc-coverage
A Doclet to generate JavaDoc coverage reports ☕️🧪📗
Stars: ✭ 23 (-46.51%)
Mutual labels:  maven
maven-dependency-tree
Apache Maven Dependency Tree
Stars: ✭ 19 (-55.81%)
Mutual labels:  maven
vacomall
☀️☀️ 基于 dubbo 实现的分布式电商平台。
Stars: ✭ 42 (-2.33%)
Mutual labels:  maven
kobby
Kobby is a codegen plugin of Kotlin DSL Client by GraphQL schema. The generated DSL supports execution of complex GraphQL queries, mutation and subscriptions in Kotlin with syntax similar to native GraphQL syntax.
Stars: ✭ 52 (+20.93%)
Mutual labels:  maven
build-helper-maven-plugin
Build Helper Maven Plugin
Stars: ✭ 77 (+79.07%)
Mutual labels:  maven
Logistics-admin
SpringBoot+adminlte+maven的物流公司管理系统
Stars: ✭ 61 (+41.86%)
Mutual labels:  maven
www-project-csrfguard
The aim of this project is to protect Java applications against CSRF attacks with the use of Synchronizer Tokens
Stars: ✭ 43 (+0%)
Mutual labels:  maven
maven-wrapper
Apache Maven Wrapper
Stars: ✭ 128 (+197.67%)
Mutual labels:  maven
cas-bootadmin-overlay
CAS Spring Boot Admin Server Overlay Template
Stars: ✭ 20 (-53.49%)
Mutual labels:  maven
keep-changelog-maven-plugin
Maven plugin to help creating CHANGELOG by keeping one format and solving merge request conflicts problem by extraction of new CHANGELOG entries to seperate files.
Stars: ✭ 22 (-48.84%)
Mutual labels:  maven
maven-dependency-analyzer
Apache Maven Dependency Analyzer
Stars: ✭ 22 (-48.84%)
Mutual labels:  maven
getting-started-with-microprofile
📙 Everything you need to know about MicroProfile
Stars: ✭ 35 (-18.6%)
Mutual labels:  maven
cas-overlay-template
Apereo CAS WAR Overlay template
Stars: ✭ 1,057 (+2358.14%)
Mutual labels:  maven
HRMS
░▒▓█ 𝑯𝒖𝒎𝒂𝒏 𝑹𝒆𝒔𝒐𝒖𝒓𝒄𝒆𝒔 𝑴𝒂𝒏𝒂𝒈𝒆𝒎𝒆𝒏𝒕 𝑺𝒚𝒔𝒕𝒆𝒎 𝑷𝒓𝒐𝒋𝒆𝒄𝒕 █▓▒░
Stars: ✭ 33 (-23.26%)
Mutual labels:  maven

Maven Incremental Module Builder

Build Status Maven Central Apache License, Version 2.0, January 2004

If you are working with larger builds sometimes it is worth to think to build only parts of the whole reactor. So it would be nice to only build those modules which have been changed. This can be controled by using the --projects option on command line.

The problem here is that you need to identify those modules which have been changed manually which can become cumbersome.

This extension will handle this automatically.

Status

  • Currently in PoC state.
  • Code needs improvements.
  • Need to write more tests / integration tests.

Prerequisites

  • Maven 3.3.1+
  • Java 7 (as Maven 3.3.1+).

How to Configure?

If you like to use this extension you have to define the following in your .mvn/extensions.xml file:

<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
  <extension>
    <groupId>com.soebes.maven.extensions</groupId>
    <artifactId>incremental-module-builder</artifactId>
    <version>0.3.0</version>
  </extension>
</extensions>

How to use it?

The first step is to do a mvn install from the root of your whole reactor.

Afterwards you can simply call Maven via mvn -b incremental package which will print out things like this:

The following will show how it looks like if you have not changed anything:

~/ws-git/supose (master)$ mvn -b incremental package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Subversion Repository Search Engine
[INFO] SupoSE :: Test
[INFO] SupoSE :: Filter
[INFO] SupoSE :: Filter : Filter Model
[INFO] SupoSE :: Filter : Filter
[INFO] SupoSE :: Core
[INFO] SupoSE :: CLI
[INFO] SupoSE :: WAR
[INFO] SupoSE :: Integration Test
[INFO] SupoSE :: Users Guide
[INFO] SupoSE :: Assembly
[INFO]  ------------------------------------
[INFO]  Maven Incremental Module Builder
[INFO]  ------------------------------------
[INFO] Executing: /bin/sh -c cd '/Users/kama/ws-git/supose' && 'git' 'rev-parse' '--show-toplevel'
[INFO] Working directory: /Users/kama/ws-git/supose
[INFO] Executing: /bin/sh -c cd '/Users/kama/ws-git/supose' && 'git' 'status' '--porcelain' '.'
[INFO] Working directory: /Users/kama/ws-git/supose
[INFO]  Nothing has been changed.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Subversion Repository Search Engine ................ SKIPPED
[INFO] SupoSE :: Test ..................................... SKIPPED
[INFO] SupoSE :: Filter ................................... SKIPPED
[INFO] SupoSE :: Filter : Filter Model .................... SKIPPED
[INFO] SupoSE :: Filter : Filter .......................... SKIPPED
[INFO] SupoSE :: Core ..................................... SKIPPED
[INFO] SupoSE :: CLI ...................................... SKIPPED
[INFO] SupoSE :: WAR ...................................... SKIPPED
[INFO] SupoSE :: Integration Test ......................... SKIPPED
[INFO] SupoSE :: Users Guide .............................. SKIPPED
[INFO] SupoSE :: Assembly ................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.277 s
[INFO] Finished at: 2016-08-06T13:29:47+02:00
[INFO] Final Memory: 13M/245M
[INFO] ------------------------------------------------------------------------

Now you have changed some files in your modules so a git status (Using Subversion will work as well) will look like this:

~/ws-git/supose (master *)$ git st
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   supose-assembly/pom.xml

no changes added to commit (use "git add" and/or "git commit -a")

Which means in consequence you only need to build the single module supose-assembly. You can call Maven manually like this:

mvn -pl supose-assembly -amd package

Using this extension you don't need to think about which modules have been changed and change every time you call Maven the command line. This extension will automatically identify the changed modules and will run the build accordingly. You can simply do it like this:

~/ws-git/supose (master *)$ mvn -b incremental package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Subversion Repository Search Engine
[INFO] SupoSE :: Test
[INFO] SupoSE :: Filter
[INFO] SupoSE :: Filter : Filter Model
[INFO] SupoSE :: Filter : Filter
[INFO] SupoSE :: Core
[INFO] SupoSE :: CLI
[INFO] SupoSE :: WAR
[INFO] SupoSE :: Integration Test
[INFO] SupoSE :: Users Guide
[INFO] SupoSE :: Assembly
[INFO]  ------------------------------------
[INFO]  Maven Incremental Module Builder
[INFO]  ------------------------------------
[INFO] Executing: /bin/sh -c cd '/Users/kama/ws-git/supose' && 'git' 'rev-parse' '--show-toplevel'
[INFO] Working directory: /Users/kama/ws-git/supose
[INFO] Executing: /bin/sh -c cd '/Users/kama/ws-git/supose' && 'git' 'status' '--porcelain' '.'
[INFO] Working directory: /Users/kama/ws-git/supose
[INFO]  scmFile: supose-assembly/pom.xml modified
[INFO] Changed Project: com.soebes.supose:supose-assembly:pom:0.7.1-SNAPSHOT
[INFO] Calculated Reactor Order:
[INFO]  SupoSE :: Assembly
[INFO] Project: com.soebes.supose:supose-assembly:pom:0.7.1-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SupoSE :: Assembly 0.7.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven) @ supose-assembly ---
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create (default) @ supose-assembly ---
[INFO] Executing: /bin/sh -c cd '/Users/kama/ws-git/supose/supose-assembly' && 'git' 'rev-parse' '--verify' 'HEAD'
[INFO] Working directory: /Users/kama/ws-git/supose/supose-assembly
[INFO] Storing buildNumber: 2cf6fbf37dbd3a0922ebd607a5b0504e76a0fd76 at timestamp: 1470483260527
[INFO] Storing buildScmBranch: master
[INFO]
[INFO] --- maven-site-plugin:3.5.1:attach-descriptor (attach-descriptor) @ supose-assembly ---
[INFO]
[INFO] --- appassembler-maven-plugin:1.10:assemble (default) @ supose-assembly ---
[INFO]
[INFO] --- maven-assembly-plugin:2.6:single (default) @ supose-assembly ---
[INFO] Reading assembly descriptor: src/main/assembly/bin.xml
[INFO] Reading assembly descriptor: src/main/assembly/bin-unix.xml
[INFO] Reading assembly descriptor: src/main/assembly/src.xml
[INFO] Building zip: /Users/kama/ws-git/supose/supose-assembly/target/supose-assembly-0.7.1-SNAPSHOT-bin.zip
[INFO] Building tar: /Users/kama/ws-git/supose/supose-assembly/target/supose-assembly-0.7.1-SNAPSHOT-bin-unix.tar.gz
[INFO] Building tar: /Users/kama/ws-git/supose/supose-assembly/target/supose-assembly-0.7.1-SNAPSHOT-src.tar.gz
[INFO] Building zip: /Users/kama/ws-git/supose/supose-assembly/target/supose-assembly-0.7.1-SNAPSHOT-src.zip
[INFO] Starting building
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.159 s
[INFO] Finished at: 2016-08-06T13:34:23+02:00
[INFO] Final Memory: 29M/450M
[INFO] ------------------------------------------------------------------------

If you like to make your Maven call more convenient you can configure this into the .mvn/maven.config like this (see Release Notes):

-b incremental

So now you can call Maven simply via mvn package. If you want to run the usual build simply this can be achieved by using the following command line:

mvn -b multithreaded package

The multithreaded defines the default builder. This means you have turned off the incremental module builder.

ToDo

  • Better error handling
  • Better checks for prerequisites.
  • Checking if artifacts have been installed in local cache before?
  • Identify edge cases where it does not work?
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].