Jason van Zyl
Manfred Moser
|
|
Hold on tight, this is going to be a wild ride! |
→ Lots of stuff happening in the Apache Maven ecosystem!
And…
|
|
Unless you are prepared to maintain those projects yourself, use Maven 3.3.3 or 3.3.7 |
Be very careful about
→ Continuing to use old stuff causes rotting.
We will look at things that …
<exclusions> with *
<parent>
~/.m2/wrapper as cache
mvn -N io.takari:maven:wrapper
And then, just use similar commands to
./mvnw clean install mvnw.cmd clean install
.mvn directory
Used for
MAVEN_OPTS
.mvn/jvm.config:
-Xmx8192m
.mvn/maven.config
-T 8 --builder smart -U
Allow different behavior of Maven itself
|
|
Large potential, but be careful… |
.mvn/extensions.xml:
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<extension>
<groupId>io.takari.aether</groupId>
<artifactId>takari-concurrent-localrepo</artifactId>
<version>0.0.7</version>
</extension>
<extension>
<groupId>io.takari.maven</groupId>
<artifactId>takari-smart-builder</artifactId>
<version>0.4.1</version>
</extension>
</extensions>
Beyond wrapper and .mvn
install
→ Can corrupt maven-metadata, mix snapshot versions,…
|
|
Takari extension to avoid problems |
Considerably reduced multi-module build times.
Use extension or install in lib
mvn -T 4 clean deploy
mvn clean deploy --builder smart -T4
|
|
Check out the documentation. |
pom.rb
<extension> <groupId>io.takari.polyglot</groupId> <artifactId>polyglot-ruby</artifactId> <version>0.1.13</version> </extension>
version = File.read( File.join( basedir, 'VERSION' ) ).strip
project 'JRuby', 'https://github.com/jruby/jruby' do
model_version '4.0.0'
inception_year '2001'
id 'org.jruby:jruby-parent', version
inherit 'org.sonatype.oss:oss-parent:7'
packaging 'pom'
organization 'JRuby', 'http://jruby.org'
[ 'headius', 'enebo', 'wmeissner', 'BanzaiMan', 'mkristian' ].each do |name|
developer name do
name name
roles 'developer'
end
end
...
pom.yaml
<extension> <groupId>io.takari.polyglot</groupId> <artifactId>polyglot-yaml</artifactId> <version>0.1.13</version> </extension>
|
|
See the source. |
modelVersion: 4.0.0
groupId: org.yaml
artifactId: snakeyaml
version: 1.17-SNAPSHOT
packaging: jar
properties: {project.scm.id: bitbucket, project.build.sourceEncoding: UTF-8}
name: SnakeYAML
...
dependencies:
- {artifactId: junit, groupId: junit, optional: false, scope: test, type: jar, version: '4.12'}
- {artifactId: spring, groupId: org.springframework, optional: false, scope: test,
type: jar, version: 2.5.6}
pom.groovy
<extension> <groupId>io.takari.polyglot</groupId> <artifactId>polyglot-groovy</artifactId> <version>0.1.13</version> </extension>
project {
modelVersion '4.0.0'
groupId 'io.takari.polyglot'
artifactId 'groovy-project'
version '0.0.1-SNAPSHOT'
build {
$execute(id: 'hello', phase: 'validate') {
println "Groovy, meet Maven"
}
}
}
→ can be used to make Maven plugins support incremental behaviour easily
|
|
Source on GitHub |
New Maven Plugin
extensions
pom, takari-jar, takari-maven-plugin, takari-maven-component
|
|
Documentation and source are open source. |
Example simple usage:
<packaging>takari-jar</packaging>
...
<build>
<plugins>
<plugin>
<groupId>io.takari.maven.plugins</groupId>
<artifactId>takari-lifecycle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
Maven plugin testing framework including IDE support:
<dependency>
<groupId>io.takari.maven.plugins</groupId>
<artifactId>takari-plugin-testing</artifactId>
<version>${takari.test.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.takari.maven.plugins</groupId>
<artifactId>takari-plugin-integration-testing</artifactId>
<version>${takari.test.version}</version>
<type>pom</type>
<scope>test</scope>
</dependency>
|
|
Check the docs |
@RunWith(MavenJUnitTestRunner.class)
@MavenVersions({"3.0.5","3.3.3"})
public class HelloFlashLightSampleIT {
Benefits:
|
|
Demo time! |
Lots of things happening:
→ Sponsored by Sonatype
And the components come from…
Input funnel for Central Repository
|
|
Feedback about docs is welcome! |
Full replication to Google Cloud Storage:
|
|
Contact us, if you want to play with it. |
It is live NOW!
Update $HOME/.m2/settings.xml to:
<settings>
<mirrors>
<mirror>
<id>google-maven-central</id>
<name>Google Maven Central</name>
<url>https://maven-central.storage.googleapis.com</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
</settings>
Or add it as proxy repository in your repository manager.
|
|
Join us on the Maven users mailing list and beyond! |
Join us for a Maven Hangout On Air
Questions, Remarks & Discussion
|
|
Slides and examples at http://takari.github.io/javaone2015/ |