Start
Entdecken
Suche senden
Hochladen
Einloggen
Registrieren
Anzeige
Check these out next
An Introduction to Maven
Vadym Lotar
Project-Builder.org Presentation
guestdd2966
OSGi In A Nutshell
Pierre-Antoine Grégoire
An introduction to Maven
Joao Pereira
Apache Maven at GenevaJUG by Arnaud Héritier
GenevaJUG
Maven 2 features
Angel Ruiz
Introduction to DevOps
Omid Vahdaty
Introduction to Aptana
Kevin III
1
von
51
Top clipped slide
Introduction to project industrialization with Maven 2
6. Oct 2009
•
0 gefällt mir
4 gefällt mir
×
Sei der Erste, dem dies gefällt
Mehr anzeigen
•
1,468 Aufrufe
Aufrufe
×
Aufrufe insgesamt
0
Auf Slideshare
0
Aus Einbettungen
0
Anzahl der Einbettungen
0
Jetzt herunterladen
Downloaden Sie, um offline zu lesen
Melden
Technologie
Yajug 06102009
Pierre-Antoine Grégoire
Folgen
I.T.Architect um Agile Partner S.A.
Anzeige
Anzeige
Anzeige
Recomendados
Android Application WebAPI Development Training
OESF Education
4.4K Aufrufe
•
271 Folien
Open Source Licenses and Tools
g2ix
960 Aufrufe
•
24 Folien
Android Application Development Advanced
OESF Education
3.4K Aufrufe
•
293 Folien
Riviera JUG (20th April, 2010) - Maven
Arnaud Héritier
860 Aufrufe
•
140 Folien
Cyber Infrastructure Day
Anthony Salvagno
337 Aufrufe
•
1 Folie
Lausanne Jug (08th April, 2010) - Maven
Arnaud Héritier
4.1K Aufrufe
•
140 Folien
Más contenido relacionado
Similar a Introduction to project industrialization with Maven 2
(20)
An Introduction to Maven
Vadym Lotar
•
13.7K Aufrufe
Project-Builder.org Presentation
guestdd2966
•
383 Aufrufe
OSGi In A Nutshell
Pierre-Antoine Grégoire
•
1.2K Aufrufe
An introduction to Maven
Joao Pereira
•
7.8K Aufrufe
Apache Maven at GenevaJUG by Arnaud Héritier
GenevaJUG
•
1.4K Aufrufe
Maven 2 features
Angel Ruiz
•
4.4K Aufrufe
Introduction to DevOps
Omid Vahdaty
•
466 Aufrufe
Introduction to Aptana
Kevin III
•
2.6K Aufrufe
Maven ppt
natashasweety7
•
4.4K Aufrufe
JDD Effective Code Review In Agile Teams
Wojciech Seliga
•
1.2K Aufrufe
SWT Lab 1
Mariano Rodriguez-Muro
•
706 Aufrufe
Maven introduction
Lai Hieu
•
533 Aufrufe
Mozilla Jetpack SDK - LinuxTag 2010
Brian King
•
668 Aufrufe
Build server
Christophe Vanlancker
•
93 Aufrufe
E D - Environmental Dependencies in Python
Adam Englander
•
253 Aufrufe
J.unit.action.2
chandra mouli
•
25.2K Aufrufe
Maven Introduction
Sandeep Chawla
•
20.4K Aufrufe
Maven.pptx
piyushkumar613397
•
8 Aufrufe
Exploring MTJ
David Marques
•
1.2K Aufrufe
Kubernetes in the wild
section_io
•
223 Aufrufe
Último
(20)
Human Centred Design and Architecting a Solution that stands the test of time...
CzechDreamin
•
0 Aufrufe
Introduction to Custom Journey Builder Activities, Orkhan Alakbarli
CzechDreamin
•
0 Aufrufe
Webinar - Making the business case - resources.pptx
OpenAthens
•
0 Aufrufe
Top 5 Tinder secrets of being the most ‘Desirable’ Salesforce consultant no o...
CzechDreamin
•
0 Aufrufe
Taking control of your queries with GraphQL, Alba Rivas
CzechDreamin
•
0 Aufrufe
Monitoring Automation Performance in Marketing Cloud Engagement, Daniela Vrbk...
CzechDreamin
•
0 Aufrufe
The minimum-profile approach – the modern way to design an efficient security...
CzechDreamin
•
0 Aufrufe
2022-02 Wizards & Executors - Mastersfund Curriculum.pdf
Gillian Muessig
•
0 Aufrufe
The CTA Mindset for Architects, Melissa Shepard & Lilith Van Biesen
CzechDreamin
•
0 Aufrufe
Ape to API, Filip Dousek
CzechDreamin
•
0 Aufrufe
20230601_FinOps_Meetup_Switzerland.pdf
Wuming Zhang
•
0 Aufrufe
Giving Back: How to Volunteer Your Salesforce Skills and Make a Difference, A...
CzechDreamin
•
0 Aufrufe
Cybersecurity Predictions for 2023
Peterson Technology Partners
•
0 Aufrufe
Skill Based Routing – The Complete Manual, Mieszko Rożej
CzechDreamin
•
0 Aufrufe
Next Generation Digital Transformation
Vishal Sharma
•
0 Aufrufe
Deep Dive into Dashboard Components, David Carnes
CzechDreamin
•
0 Aufrufe
Why do you Need to Migrate to Salesforce Flow?, Andrew Cook
CzechDreamin
•
0 Aufrufe
How do you know you’re solving the right problem? Design Thinking for Salesfo...
CzechDreamin
•
0 Aufrufe
No Such Thing as Best Practice in Design, Nati Asher and Pat Fragoso
CzechDreamin
•
0 Aufrufe
Want to demo like a salesforce solution engineer?, Jasmine Ashley
CzechDreamin
•
0 Aufrufe
Anzeige
Introduction to project industrialization with Maven 2
Introduction to project industrialization
using Maven YaJUG 06/10/2009 Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Event http://www.yajug.lu
October 06 2009 Best Practices and Tools for your build environments Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Speaker Pierre-Antoine
Grégoire I.T.Architect at Occasional committer in open source projects Dislikes buzzwords (SOA, EDA…), likes to conceptualize and build architectures Thinks having fun and working seriously (both at the same time) should be mandatory! Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Who are you?
Who in the audience is currently coding at work? Who in the audience is managing the lucky coders? Who is already using Maven 2+? Who is planning on using it and came to have more information? Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Planning Software
development is engineering A bit of history Why Maven? An introduction to Maven Drawbacks of Maven Best practices Maven 3.x preview Maven in a Software development suite Textual content under Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Software development is
engineering Since the early days of modern engineering, automation of build processes has been the key to: Productivity improvements Quality insurance Failure-Proofing Why would software development be any different? Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Software development is
engineering How do you really enable automation of build? Build has to be reproducible Build has to produce the final production artifact Build has to be as easy to maintain as possible and well documented Build has to contribute to the standardization effort Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Planning Software
development is engineering A bit of history Why Maven? An introduction to Maven Drawbacks of Maven Best practices Maven 3.x preview Maven in a Software development suite Textual content under Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
A bit of
history Software craftmens are lazy, so they are looking for efficiency (or the other way around… ) One command line to launch for a build, OK Two command lines to launch for a build, BAD enough More… forget it… Disclaimer: I’m one of these lazy craftmen… Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
A bit of
history A simple script (.sh, .bat) is already a possible solution More advanced command-line tools have been available for a long time make created in 1977 at Bells Labs by Stuart Feldman Still very much used nowadays Apache Ant created by James Duncan Davidson Was at first a platform-independent build system for Tomcat because Sun’s build system for Servlet RI (From which Tomcat was derived) was specific to Solaris. Released separately in 2000 Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
A bit of
history Two main categories in current tools Scripting tools Ant and derived (XML) Rake (Ruby based) Gradle (Groovy based) … many others Artifact oriented tools Maven Debian Package Creation Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
A bit of
history Maven 1.x is now a 10 years old project, mostly motionless since 2007 (no insult intended to people still using it or committing to it) Maven 2.x is the de facto standard for Java and Java EE build Most open source projects are switching to Maven for their build system It’s now five years old Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Planning Software
development is engineering A bit of history Why Maven? An introduction to Maven Drawbacks of Maven Best practices Maven 3.x preview Maven in a Software development suite Textual content under Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Why Maven?
Nowadays, build tools are not really used by developers directly. IDEs are increasing their functionalities scope, Compilation is almost always done on the fly Package and server startup is monitored by rich Uis Step-by-step debugging is a killer feature Build tools like Maven 2 are used to build the package you will put into production! This should never be done by an IDE, nor by hand! Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Why Maven?
If you are not already using it: Now is the best moment to start being aware Maven is mature Maven is getting better and better Maven can be used online, offline, and in enterprise environment If you are already using it: Hang on! The best is yet to come! Focus on necessary things and don’t get frustrated by petty details Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Planning Software
development is engineering A bit of history Why Maven? An introduction to Maven Drawbacks of Maven Best practices Maven 3.x preview Maven in a Software development suite Textual content under Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven Maven 2 is a tool with multiple facets: a BUILD tool a DEPENDENCY MANAGEMENT tool a DOCUMENTATION tool Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven Project Object Model pom.xml mvn Generated artifacts (jar, war, ear…), Documentation, statistics (test results, quality metrics, javadoc, web site)… Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven A project can easily be cut into modules thanks to Maven 2 By simply declaring project metadata and optionally configuring a few plug-ins, you can: Build your project (compile, generate sources…) Launch tests and gather results (Junit, TestNG, Selenium…etc) Package (Jar, War, Ejb, War…etc) Document and generate reports Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven Project Object Model (POM) Basic project information groupId, artifactId, version… Inheritance, or Aggregation through sub-modules (we’ll explain the difference later on) Build section Project layout (sources and resources folders… etc) Build plugins configuration Reporting section Reports configuration Some other advanced environment settings Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven A plug-in is made of a MOJO (Maven POJO) which is simply a java class with Maven-specific metadata. A plug-in can define goals and reports Goals can be called directly: mvn plugin:goal Goals can be bound to one or multiple phases Reports are used during site generation mvn site Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven Phase compile mojo mojo test mojo package Plug-ins install mojo mojo deploy Mojos define Goals (fine Lifecycle grained tasks) Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven When you invoke a phase, Maven 2 will go through all the phases until the one specified, executing the bound goals: mvn package compile compiler:compile test surefire:test package jar:jar Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven There are many more phases than in previous examples in the default lifecycle By default, all the basic necessary plug-ins for the build phase are already bound to phases It is easy to have information about plugins: mvn help:describe So….. what’s left to do, and what’s all the fuss about the complexity of Maven 2? Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven Dependencies: A blessing and a curse Blessing: almost all java build tools nowadays leverage the Maven 2 repositories (cf. Ivy, Ant, Gradle…etc) easier to find/discover/use java libraries Curse: Transitive dependencies can rapidly trigger a dependency hell! Curse: Harder to stabilize builds Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven What really made Maven different from other builds systems in the first place? REPOSITORIES!!! Before Maven, it was really hard to find java libraries, and harder to ensure a coherent use of these libraries (I’m saying hard, not impossible…) Nowadays, it’s still very hard to find some jars with a decent/coherent versioning (discretely winking in the general direction of Sun participants...), let alone to find their sources or javadocs Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven Local repository Corporate repository/ proxy Public repository Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven Local repository: Local repository Local cache for artifacts Corporate repository/ proxy Local private sandbox Public repository It should be possible to erase it regularly Very useful for offline builds By default in user home’s .m2/ folder Can be moved to another place through Maven 2 runtime’ settings.xml file $MAVEN_HOME/conf/settings.xml Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven Corporate repository/proxy Local repository Very useful tool Corporate repository/ proxy The first necessary step towards a Public repository corporate use of maven Can be as simple as a corporate http server exposing a repository Even better: install a repository management tool Can proxy external repositories Can filter unwanted artifacts Build even without internet access! (well… at least for the repository management tool) Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven Public repositories Local repository Good for dependencies’ harvesting Corporate repository/ proxy Should be proxied in corporate Public repository environments… or even for your personal use! A lot of mis-configured dependencies A lot of alpha/beta Maven 2 plug- ins Be cautious when adding public repositories to a build process! Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven Other key features of Maven: POM Inheritance/Aggregation Archetypes Launching Tests … many more… Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven POM Inheritance vs. POM Aggregation POM Inheritance: a POM and all its parent POMs will be flattened at runtime In the end only one effective POM in memory This is mostly used to share common configuration POM Aggregation: declare modules in a given project If a command is issued against a project, it will be also issued against all its modules This is mostly used to organize builds and gather projects that should be built simultaneously Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven Project Archetypes You can build template projects and make them available as artifacts in the repositories Allows to share best practices without neither inheritance nor aggregation mvn archetype:create-from-project mvn archetype:generate Many Archetypes already configured in the default catalog You can easily build a custom or corporate catalog mvn archetype:generate –DarchetypeCatalog=http://www.corporate.com/ archetypes.xml Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
An introduction to
Maven Launching Tests Maven 2 allows to launch various types of tests: Unit tests: Junit 3.x or 4.x, TestNG, … UI Tests: Selenium, Canoo Webtest Functional tests: Fitnesse, Greenpepper WebServices tests: SOAPUi And many more… Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Planning Software
development is engineering A bit of history Why Maven? An introduction to Maven Drawbacks of Maven Best practices Maven 3.x preview Maven in a Software development suite Textual content under Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Drawbacks of Maven
If you don’t embrace the standardization brought by Maven 2, you’ll soon feel limited by Maven 2 Additionally, standardization can be quite expensive! Measure the implied cost by testing on 2 subsequent projects (one to absorb the POC effect, and one for measure) By default Maven 2 has its own folder structure normalization, unknown to IDEs (though this is not completely true anymore) Last but not least: Maven 2 error reporting is SO BAAAAD! Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Worst practices You want
more drawbacks? GET MORE OF THEM! Use maven-antrun-plugin a lot! So coool, this way you can use Maven and not Ant! Build very intricated projects with modules having modules themselves, and lots of inheritances all around! Niiice! This allows you to spend more time with your favorite tool: Maven 2 in order to find out where your damn properties/dependencies are defined! Replace your IDE with Maven and try to add all of your IDE’s functionalities as Maven plugins!!!!! You got my point ;) Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Planning Software
development is engineering A bit of history Why Maven? An introduction to Maven Drawbacks of Maven Best practices Maven 3.x preview Maven in a Software development suite Textual content under Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Best practices They will
allow you to overcome Maven 2’s drawbacks Embrace the standardization brought by Maven 2, don’t fight it Use POM Inheritance and <dependencyManagement> (with import scope), <pluginManagement> to tame the transitive dependencies. (don’t mistake these for <dependencies>, <plugins>…) Use a Repository Manager: Sonatype Nexus: http://nexus.sonatype.org Jfrog Artifactory: http://artifactory.jfrog.org … Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Best practices
Don’t use Maven’s integrated reporting anymore It was meant for Apache project’s web sites static documentation The amount of time spent in order to build them is not worth it in enterprise environment Keep your build as simple as possible Generate test statistics data and other metrics data in order to exploit them in Software quality tools: Sonar: http://sonar.codehaus.org Squale: http://www.squale.org … Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Best practices
If you provide a standard environment, try to make Maven plugins have a match in the IDE If Maven 2 launches Checkstyle, provide the Checkstyle Eclipse plugin to your projects. Launch your builds regularly and possibly in a neutral zone (not on the developer’s desktop!) in order to ensure “rule number one” is respected: Build must be reproducible. Use the “dependency” and “versions” plugins to handle dependencies and diagnose dependencies mismatches or errors Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Best practices
Documentation and information: Site http://maven.apache.org Plugins http://maven.apache.org/plugins http://mojo.codehaus.org/ http://code.google.com/ And many others… Project Wiki http://docs.codehaus.org/display/MAVEN/ Users’ Wiki http://docs.codehaus.org/display/MAVENUSER Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Best practices
Books Free electronic editions: Definitive Guide: http://www.sonatype.com/books Better Builds with Maven: http://www.maestrodev.com/better-build-maven Upcoming book by Arnaud Héritier and Nicolas De Loof http://www.pearson.fr/livre/?GCOI=27440100730370 Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Planning Software
development is engineering A bit of history Why Maven? An introduction to Maven Drawbacks of Maven Best practices Maven 3.x preview Maven in a Software development suite Textual content under Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Maven 3.x Preview
DISCLAIMER!!! Everything mentioned here could end up being COMPLETELY FALSE!!! (though project is now well advanced) Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Maven 3.x Preview
New release planned for this autumn/winter Lots of refactorings of the insides of Maven 2 Not immediately obvious (in a way this is better than the complete product change between Maven 1 and 2) Will allow to tackle upcoming challenges and regular issues of Maven 2 in a more elegant manner Simplifies plug-in development Efficient embedder Maven 2 has lots of singletons and such and is therefore improper for use in multithreaded environments (CIM, IDE) Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Maven 3.x Preview
Backward compatibility Loads of Integration testing is done to ensure backwards compatibility Stricter validation of the POM Configured plugins should have their versions specified (a warning appears otherwise) Site/reporting is now completely extracted from the Maven core Currently the Site plugin doesn’t work with Maven 3, yet should until the final release (though reports still work) Recommended to switch to the use of external quality monitoring tools Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Maven 3.x Preview
If you plan to migrate or want to evaluate: http://cwiki.apache.org/confluence/display/MAVEN/ Maven+3.x+Compatibility+Notes Presentation by Jason van Zyl (Sonatype) http://www.scribd.com/doc/14458957/Jasons-Maven-3- Presentation My first impressions: Maven 3 looks awesome! Embedder is a killer feature The IDE can literally listen for the Build process, and be part of it, not just launch it. Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Maven 3.x Preview
What will be new to users: Versionless parent elements Better version delegation Better error and integrity reporting XML Pom format using attributes instead of elements Scripted POM Formats (pom.{rb|groovy|py}) What will be new to plugin developers: Plugin extension points Annotations instead of old javadoc tags Lifecycle extension points Queryable lifecycle Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Maven in a
Software development suite Maven is now very well integrated in IDEs NetBeans 6.5+ now has very good support for Maven 2 Eclipse 3.x has very good support also, with preview of Maven 3.x embedder (blazingly fast!) IntelliJ IDEA seems to have excellent support also (though this is why you pay for it isn’t it?) Maven works very well with Quality monitoring tools Maven 3 will most likely increase the embedding of Maven and its use for other JVM Languages and possibly for other platforms Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
References and Thanks
Many thanks to Arnaud Héritier He allowed me to be inspired by some of its recent slides presented to the French Ch’ti JUG http://blog.aheritier.net He also was kind enough to review this presentation ;) Many thanks to Jason van Zyl for its Maven 3 presentation I was heavily inspired by http://www.sonatype.com/people/author/jason Copyright © Pierre-Antoine Grégoire License Creative Commons 2.0
Anzeige