Presentation is loading. Please wait.

Presentation is loading. Please wait.

Maven 04 March 2016 1 1.

Similar presentations


Presentation on theme: "Maven 04 March 2016 1 1."— Presentation transcript:

1 Maven 04 March 2016 1 1

2 Introduction Java projects originally managed with Ant
Manual build process Ant scripts to compile, generate IDL, jar Low-level scripting No dependency management No version management 2

3 Introduction Java projects originally managed with Ant
Manual build process Ant scripts to compile, generate IDL, jar Low-level scripting No dependency management No version management Maven provides high-level features for build process 3

4 Maven vs Ant Ant originated from the Apache Tomcat project in early 2000 Individual build.xml No constraints on the build process Maven initial release in july 2004 Shared pom.xml Published on shared repositories Build process constrained Constraints on the sources: must follow locations: src/main/java, ... 4

5 Maven build lifecycle Artifact concept Java “package” to be deployed
Different types of artifact (jar, war, plugin, …) Dependent lifecycle Phases for jar process-resources, compile, process-test- resources, test-compile, test, package, install, deploy Default behaviour 5

6 Maven dependencies All the dependencies are defined Example :
<dependency> <groupId>avalon-framework</groupId> <artifactId>avalon-framework-impl</artifactId> <version>4.2.0</version> </dependency> Maven automatically updates and downloads the jar Manual update of the project must be done sometimes that is NOT update of the sources by SVN 6

7 Maven repositories Important concept of Maven
Every artifact is published to a repository 4 types of repository Central Public Private Local 7

8 Maven repositories Nexus Repository ILL private https://maven.ill.fr/
Releases Snapshots Central mirror or proxy Thirdparty Compilation on the instruments Nexus users, right to publish snapshots, releases 8

9 Maven plugins A type of dependency Customize the build Examples
Force compilation in Java 1.7 rather than default Incorporate SVN revision in jar Generate a single jar that contains all the dependencies Android support Share the code 9

10 Code versioning Every artifact has a version
Nomad and NomadCommandSystem must be versioned Nomad and NomadCommandSystem can have dissociated versions Nomad can reference an older NomadCommandSystem Version strategy to be defined 10

11 Code versioning strategy
Release vs Snapshot Deploy a release only once Deploy multiple snapshots during development Version deployment example 1.2.1 deployed 1.2.2-SNAPSHOT deployed 1.2.2 deployed Changelog to be updated (ideally for each commit) 11

12 Code versioning strategy
Version numbering Not important for an application (e.g. NomadGUI) Important for a library (e.g. NomadCommmandSystem) We can discuss it major.minor.revision 12

13 Profiles Possibility to define profiles Build for different platforms
SWT profiles for GTK 32bits, GTK 64bits Default profile in .m2/settings.xml 13

14 Modules Maven own module concept A module inherits parent pom.xml
Deployment can be independent Project NomadGUISpecialModules 14

15 Day to day usage Maven not required to run NomadGUI
Maven required to compile NomadGUI, NomadCommandSystem, Cameo server and API Eclipse integration Command-line > mvn install > mvn -P gtk_linux_x86 install 15

16 Conclusion Maven has lots of features
But with a well-defined organization, will bring more than it costs 16


Download ppt "Maven 04 March 2016 1 1."

Similar presentations


Ads by Google