SlideShare uma empresa Scribd logo
1 de 47
MAV
EN
the Wonderful World of Maven and Flexmojos
1. definition
More than just a build tool -
Maven is project management.
It’s built in Java and lives under the Apache umbrella,
              (∴ still new to Flex developers)
it promotes convention over configuration
and, it is hierarchical.
Everything builds via a Project Object Model
         (POM): aka the blueprint.
A build generates one or more artifacts.
   (Typically one artifact per POM)
Artifacts are classified by groupId,
artifactId, packaging (type) and version.
Versions stamped with SNAPSHOT are
            treated as such.
Eg. the Flex framework dependency
              groupId:   com.adobe.flex.framework
           artifactId:   flex-framework
              version:   4.5.1.21328
            packaging:   pom



    Artifacts are filed away in repositories using:
/[groupId]/[artifactId]/[version]/[artifactId]-[version].[ext]
2. building
A goal is a single action.
A phase is a collection of goals. [M:M]
A lifecycle is a sequence of phases (upto & including).
The odd couple: clean & install.
        > mvn clean install
The packaging (eg. SWF, SWC, JAR) typically
     defines the goals within each phase.
In general, the default lifecycle involves the
              following phases:

■ validate
■ compile
■ test
■ package
■ integration-test
■ verify
■ install
■ deploy
In addition, plugins provide goals and can bind
                them to phases.
    eg. > mvn compiler:compile compiler:testCompile
Plugins include compiler, install, scm, release,
       javadoc, eclipse, flexmojos, etc.
3. dependencies
Dependencies are hosted in repositories.
Each install of Maven has a repository.
   (~/.m2 is your new best friend).
In order to add new dependencies to your
       repository, you can simply
     > mvn install:install-file
You add references to repositories either in
  your POM or in your settings.xml file.
When building, if a dependency is missing,
 Maven will try to download it from an
         upstream repository.
As a last resort, it will check Maven Central
             (search.maven.org).
How are dependencies shared across
           repositories?

             Nexus.
Nexus allows an organisation to share artifacts
       both internally and externally.
It has out-of-the-box support for both
 snapshot and release repositories.
So, what about dependencies on teh internez?
Nexus will proxy to other external Nexus
              repositories.
If the dependency isn’t hosted - there’s a 3rd
     Party repo that you can upload into.
4. the flexmojos plugin
Out of the box, Flexmojos supports:

  ★   Flex 3/4, AIR and AS3 projects
  ★   Unit tests & code coverage reports
  ★   ASDoc generation
  ★   RSL and runtime module support
  ★   Goal to create IDE project
  ★   SWF optimization
  ★   Archetypes to get started
  ★   WAR bundling & deployment
Goals bound to the default
 SWF and SWC lifecycles
function preinit()
{


   download(maven, ‘3.0.3’).install().append(system.path);


   download(flashplayer-standalone,
‘10.3’).install().append(system.path);

	   flashbuilder.plugins.add(m2eclipse);

}




        First you have to setup your environment.
#1.
        Use a Flexmojos archetype to get started.

mvn archetype:generate
-DarchetypeRepository=http://repository.sonatype.com/content/groups/flexgroup
-DarchetypeGroupId=org.sonatype.flexmojos
-DarchetypeArtifactId=flexmojos-archetypes-application
-DarchetypeVersion=4.0-RC2
#2.
   Add repo location of Flex SDK.
http://repository.sonatype.org/content/groups/flexgroup
#3.
   Build.
mvn clean install
#4.
Import Maven project into Flashbuilder
#5.
Check project settings - source folders, compiler and
                       config.
#6.
Setup Maven build and debug as required.
Tip: Only check in /src and your POM -
  everything else can be generated.
5. fin
Don’t skim the conventions.
Learn the basics and save yourself hours of
           endless frustration.
Links and more info:

★   ADC series on Flex & Maven
★   Flexmojos 4.0-RC2 plugin docs
★   My Examples on Github
★   Flexmojos Google Group
★   Flexmojos on Github
★   Maven guide with Flexmojos
★   Follow @flexmojos on Twitter


        about.me/justinj

Mais conteúdo relacionado

Mais procurados

OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive
OpenCmsDays 2013 - Using OpenCms 9 folders as a network driveOpenCmsDays 2013 - Using OpenCms 9 folders as a network drive
OpenCmsDays 2013 - Using OpenCms 9 folders as a network driveAlkacon Software GmbH & Co. KG
 
Maven from Scratch to Production (.odp)
Maven from Scratch to Production (.odp)Maven from Scratch to Production (.odp)
Maven from Scratch to Production (.odp)Johan Mynhardt
 
Apache Maven for SoftServe IT Academy
Apache Maven for SoftServe IT AcademyApache Maven for SoftServe IT Academy
Apache Maven for SoftServe IT AcademyVolodymyr Ostapiv
 
Dockerized tests with dockerized jenkins
Dockerized tests with dockerized jenkinsDockerized tests with dockerized jenkins
Dockerized tests with dockerized jenkinsFernando Valverde
 
OSGi Enablement For Apache Tuscany
OSGi Enablement For Apache TuscanyOSGi Enablement For Apache Tuscany
OSGi Enablement For Apache TuscanyRaymond Feng
 
Streamlining Agile Linux Development with Docker and RHEL Atomic
Streamlining Agile Linux Development with Docker and RHEL AtomicStreamlining Agile Linux Development with Docker and RHEL Atomic
Streamlining Agile Linux Development with Docker and RHEL AtomicMichael Solberg
 
How to write a Dockerfile
How to write a DockerfileHow to write a Dockerfile
How to write a DockerfileKnoldus Inc.
 
Ordina Accelerator program 2019 - Quality assurance
Ordina Accelerator program 2019 - Quality assuranceOrdina Accelerator program 2019 - Quality assurance
Ordina Accelerator program 2019 - Quality assuranceBert Koorengevel
 
Intro 2 docker
Intro 2 dockerIntro 2 docker
Intro 2 dockerHanoiJUG
 
Automated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yardsAutomated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yardsJohn Ferguson Smart Limited
 
Introduction to Apache Maven
Introduction to Apache MavenIntroduction to Apache Maven
Introduction to Apache MavenRajind Ruparathna
 
Docker 導入:障礙與對策
Docker 導入:障礙與對策Docker 導入:障礙與對策
Docker 導入:障礙與對策William Yeh
 
Version Management in Maven
Version Management in MavenVersion Management in Maven
Version Management in MavenGeert Pante
 
Ordina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - MavenOrdina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - MavenBert Koorengevel
 

Mais procurados (20)

OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive
OpenCmsDays 2013 - Using OpenCms 9 folders as a network driveOpenCmsDays 2013 - Using OpenCms 9 folders as a network drive
OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive
 
Composer namespacing
Composer namespacingComposer namespacing
Composer namespacing
 
Travis CI - PHP
Travis CI - PHPTravis CI - PHP
Travis CI - PHP
 
Apache Maven
Apache MavenApache Maven
Apache Maven
 
Maven from Scratch to Production (.odp)
Maven from Scratch to Production (.odp)Maven from Scratch to Production (.odp)
Maven from Scratch to Production (.odp)
 
Apache Maven for SoftServe IT Academy
Apache Maven for SoftServe IT AcademyApache Maven for SoftServe IT Academy
Apache Maven for SoftServe IT Academy
 
Maven
MavenMaven
Maven
 
Apache Maven
Apache MavenApache Maven
Apache Maven
 
Container BoM Inspection with TERN
Container BoM Inspection with TERNContainer BoM Inspection with TERN
Container BoM Inspection with TERN
 
Dockerized tests with dockerized jenkins
Dockerized tests with dockerized jenkinsDockerized tests with dockerized jenkins
Dockerized tests with dockerized jenkins
 
OSGi Enablement For Apache Tuscany
OSGi Enablement For Apache TuscanyOSGi Enablement For Apache Tuscany
OSGi Enablement For Apache Tuscany
 
Streamlining Agile Linux Development with Docker and RHEL Atomic
Streamlining Agile Linux Development with Docker and RHEL AtomicStreamlining Agile Linux Development with Docker and RHEL Atomic
Streamlining Agile Linux Development with Docker and RHEL Atomic
 
How to write a Dockerfile
How to write a DockerfileHow to write a Dockerfile
How to write a Dockerfile
 
Ordina Accelerator program 2019 - Quality assurance
Ordina Accelerator program 2019 - Quality assuranceOrdina Accelerator program 2019 - Quality assurance
Ordina Accelerator program 2019 - Quality assurance
 
Intro 2 docker
Intro 2 dockerIntro 2 docker
Intro 2 docker
 
Automated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yardsAutomated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yards
 
Introduction to Apache Maven
Introduction to Apache MavenIntroduction to Apache Maven
Introduction to Apache Maven
 
Docker 導入:障礙與對策
Docker 導入:障礙與對策Docker 導入:障礙與對策
Docker 導入:障礙與對策
 
Version Management in Maven
Version Management in MavenVersion Management in Maven
Version Management in Maven
 
Ordina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - MavenOrdina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - Maven
 

Semelhante a Wonderful World of Maven

An Introduction to Maven and Flex
An Introduction to Maven and FlexAn Introduction to Maven and Flex
An Introduction to Maven and FlexJustin J. Moses
 
Introduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS worldIntroduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS worldDmitry Bakaleinik
 
Apache maven, a software project management tool
Apache maven, a software project management toolApache maven, a software project management tool
Apache maven, a software project management toolRenato Primavera
 
Maven with Flex
Maven with FlexMaven with Flex
Maven with FlexPriyank
 
Maven with Flex
Maven with FlexMaven with Flex
Maven with FlexPriyank
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topicGourav Varma
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld PresentationDan Hinojosa
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulMert Çalışkan
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 featuresAngel Ruiz
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...Paul Withers
 
(Re)-Introduction to Maven
(Re)-Introduction to Maven(Re)-Introduction to Maven
(Re)-Introduction to MavenEric Wyles
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - ExplainedSmita Prasad
 
Node JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applicationsNode JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applicationsExpeed Software
 

Semelhante a Wonderful World of Maven (20)

An Introduction to Maven and Flex
An Introduction to Maven and FlexAn Introduction to Maven and Flex
An Introduction to Maven and Flex
 
Maven
MavenMaven
Maven
 
Introduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS worldIntroduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS world
 
Apache maven, a software project management tool
Apache maven, a software project management toolApache maven, a software project management tool
Apache maven, a software project management tool
 
Build server
Build serverBuild server
Build server
 
Maven with Flex
Maven with FlexMaven with Flex
Maven with Flex
 
Maven with Flex
Maven with FlexMaven with Flex
Maven with Flex
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
Maven basics
Maven basicsMaven basics
Maven basics
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld Presentation
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 features
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
 
(Re)-Introduction to Maven
(Re)-Introduction to Maven(Re)-Introduction to Maven
(Re)-Introduction to Maven
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - Explained
 
Exploring Maven SVN GIT
Exploring Maven SVN GITExploring Maven SVN GIT
Exploring Maven SVN GIT
 
Mavennotes.pdf
Mavennotes.pdfMavennotes.pdf
Mavennotes.pdf
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 
Node JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applicationsNode JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applications
 

Último

2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdfThe Good Food Institute
 
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTSIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTxtailishbaloch
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfTejal81
 
Patch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 updatePatch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 updateadam112203
 
How to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptxHow to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptxKaustubhBhavsar6
 
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechWebinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechProduct School
 
UiPath Studio Web workshop Series - Day 3
UiPath Studio Web workshop Series - Day 3UiPath Studio Web workshop Series - Day 3
UiPath Studio Web workshop Series - Day 3DianaGray10
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
Where developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingWhere developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingFrancesco Corti
 
LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0DanBrown980551
 
Scenario Library et REX Discover industry- and role- based scenarios
Scenario Library et REX Discover industry- and role- based scenariosScenario Library et REX Discover industry- and role- based scenarios
Scenario Library et REX Discover industry- and role- based scenariosErol GIRAUDY
 
Novo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNovo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNeo4j
 
CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024Brian Pichman
 
Flow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First FrameFlow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First FrameKapil Thakar
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Libraryshyamraj55
 
Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...DianaGray10
 
Extra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdfExtra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdfInfopole1
 
AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024Brian Pichman
 
Graphene Quantum Dots-Based Composites for Biomedical Applications
Graphene Quantum Dots-Based Composites for  Biomedical ApplicationsGraphene Quantum Dots-Based Composites for  Biomedical Applications
Graphene Quantum Dots-Based Composites for Biomedical Applicationsnooralam814309
 
March Patch Tuesday
March Patch TuesdayMarch Patch Tuesday
March Patch TuesdayIvanti
 

Último (20)

2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf
 
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTSIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
 
Patch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 updatePatch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 update
 
How to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptxHow to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptx
 
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechWebinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
 
UiPath Studio Web workshop Series - Day 3
UiPath Studio Web workshop Series - Day 3UiPath Studio Web workshop Series - Day 3
UiPath Studio Web workshop Series - Day 3
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Where developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingWhere developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is going
 
LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0
 
Scenario Library et REX Discover industry- and role- based scenarios
Scenario Library et REX Discover industry- and role- based scenariosScenario Library et REX Discover industry- and role- based scenarios
Scenario Library et REX Discover industry- and role- based scenarios
 
Novo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNovo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4j
 
CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024
 
Flow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First FrameFlow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First Frame
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Library
 
Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...
 
Extra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdfExtra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdf
 
AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024
 
Graphene Quantum Dots-Based Composites for Biomedical Applications
Graphene Quantum Dots-Based Composites for  Biomedical ApplicationsGraphene Quantum Dots-Based Composites for  Biomedical Applications
Graphene Quantum Dots-Based Composites for Biomedical Applications
 
March Patch Tuesday
March Patch TuesdayMarch Patch Tuesday
March Patch Tuesday
 

Wonderful World of Maven

  • 1. MAV EN the Wonderful World of Maven and Flexmojos
  • 3. More than just a build tool - Maven is project management.
  • 4. It’s built in Java and lives under the Apache umbrella, (∴ still new to Flex developers)
  • 5. it promotes convention over configuration
  • 6. and, it is hierarchical.
  • 7. Everything builds via a Project Object Model (POM): aka the blueprint.
  • 8. A build generates one or more artifacts. (Typically one artifact per POM)
  • 9. Artifacts are classified by groupId, artifactId, packaging (type) and version.
  • 10. Versions stamped with SNAPSHOT are treated as such.
  • 11. Eg. the Flex framework dependency groupId: com.adobe.flex.framework artifactId: flex-framework version: 4.5.1.21328 packaging: pom Artifacts are filed away in repositories using: /[groupId]/[artifactId]/[version]/[artifactId]-[version].[ext]
  • 13. A goal is a single action.
  • 14. A phase is a collection of goals. [M:M]
  • 15. A lifecycle is a sequence of phases (upto & including).
  • 16. The odd couple: clean & install. > mvn clean install
  • 17. The packaging (eg. SWF, SWC, JAR) typically defines the goals within each phase.
  • 18. In general, the default lifecycle involves the following phases: ■ validate ■ compile ■ test ■ package ■ integration-test ■ verify ■ install ■ deploy
  • 19. In addition, plugins provide goals and can bind them to phases. eg. > mvn compiler:compile compiler:testCompile
  • 20. Plugins include compiler, install, scm, release, javadoc, eclipse, flexmojos, etc.
  • 22. Dependencies are hosted in repositories.
  • 23. Each install of Maven has a repository. (~/.m2 is your new best friend).
  • 24. In order to add new dependencies to your repository, you can simply > mvn install:install-file
  • 25. You add references to repositories either in your POM or in your settings.xml file.
  • 26. When building, if a dependency is missing, Maven will try to download it from an upstream repository.
  • 27. As a last resort, it will check Maven Central (search.maven.org).
  • 28. How are dependencies shared across repositories? Nexus.
  • 29. Nexus allows an organisation to share artifacts both internally and externally.
  • 30. It has out-of-the-box support for both snapshot and release repositories.
  • 31. So, what about dependencies on teh internez?
  • 32. Nexus will proxy to other external Nexus repositories.
  • 33. If the dependency isn’t hosted - there’s a 3rd Party repo that you can upload into.
  • 35. Out of the box, Flexmojos supports: ★ Flex 3/4, AIR and AS3 projects ★ Unit tests & code coverage reports ★ ASDoc generation ★ RSL and runtime module support ★ Goal to create IDE project ★ SWF optimization ★ Archetypes to get started ★ WAR bundling & deployment
  • 36. Goals bound to the default SWF and SWC lifecycles
  • 37. function preinit() { download(maven, ‘3.0.3’).install().append(system.path); download(flashplayer-standalone, ‘10.3’).install().append(system.path); flashbuilder.plugins.add(m2eclipse); } First you have to setup your environment.
  • 38. #1. Use a Flexmojos archetype to get started. mvn archetype:generate -DarchetypeRepository=http://repository.sonatype.com/content/groups/flexgroup -DarchetypeGroupId=org.sonatype.flexmojos -DarchetypeArtifactId=flexmojos-archetypes-application -DarchetypeVersion=4.0-RC2
  • 39. #2. Add repo location of Flex SDK. http://repository.sonatype.org/content/groups/flexgroup
  • 40. #3. Build. mvn clean install
  • 41. #4. Import Maven project into Flashbuilder
  • 42. #5. Check project settings - source folders, compiler and config.
  • 43. #6. Setup Maven build and debug as required.
  • 44. Tip: Only check in /src and your POM - everything else can be generated.
  • 46. Don’t skim the conventions. Learn the basics and save yourself hours of endless frustration.
  • 47. Links and more info: ★ ADC series on Flex & Maven ★ Flexmojos 4.0-RC2 plugin docs ★ My Examples on Github ★ Flexmojos Google Group ★ Flexmojos on Github ★ Maven guide with Flexmojos ★ Follow @flexmojos on Twitter about.me/justinj

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n