During long time maven has been the defacto build tool and dependency management for java projects. Since previous version some cool things has been added by plugins but now maven has been enriched with new features learning from the others.
All these new stuff is thanks to Takiri which is lead by Jason van Zyl (@jvanzyl) the maven’s father.
Requirements:
- Maven 3.3.1
- Java 7
Maven Lifecycle
Avoid the re-compilation if there are no changes in the source code. Just is needed two simple steps to enable this awesome feature. Save your time!!!
1. Add plugin below:
1 2 3 4 5 6 7 8 9 |
|
2. Switch your current packaging
from jar
to takari-jar
.
You can see the log to see if the plugin take effect. If you have compiled previously and you do again with after these configuration then no compilation will be done but if there are any change in your source code then it will compile again.
Maven Polyglot
Build pom
file in xml format is verbose. Now, you can build your pom in different languages: atom, clojure, groovy, ruby, scala, yaml. And take advantage of each one.
Pre-requisite:
- Inside the project create
.mvn/extensions.xml
file, where language dependency will take place:
Atom
1 2 3 4 5 6 7 8 |
|
Clojure:
1 2 3 4 5 6 7 8 |
|
Groovy
1 2 3 4 5 6 7 8 |
|
Ruby
1 2 3 4 5 6 7 8 |
|
Scala
1 2 3 4 5 6 7 8 |
|
Yaml
1 2 3 4 5 6 7 8 |
|
Would you like to migrate your xml to any other language? You can do it running the command below:
1
|
|
Where format
could be atom
, clj
, groovy
, rb
, scala
and yml
.
Maven Wrapper
Share projects is common and sometimes we have specific version from our build tool. Now, you don’t need to ask to your friend which maven version you need if the maven project use maven-wrapper
. To do that, you just need to run:
1
|
|
Now you can make a build mvnw clean install
. If you like to see which maven version you will download take a look at .mvn/wrapper/maven-wrapper.properties
inside your project.