1 / 16

Maven 04 March 2016

Maven 04 March 2016. 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. Introduction. Java projects originally managed with Ant

sophiah
Download Presentation

Maven 04 March 2016

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Maven 04 March 2016

  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

  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

  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

  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

  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

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

  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

  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

  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

  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-SNAPSHOT deployed • … • 1.2.2 deployed • Changelog to be updated (ideally for each commit)

  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

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

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

  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

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

More Related