Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.
MAVENthe 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 ...
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■ integrati...
In addition, plugins provide goals and can bind                them to phases.    eg. > mvn compiler:compile compiler:test...
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...
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’).ins...
#1.        Use a Flexmojos archetype to get started.mvn archetype:generate-DarchetypeRepository=http://repository.sonatype...
#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 ...
Próxima SlideShare
Cargando en…5
×

Wonderful World of Maven

2.043 visualizaciones

Publicado el

An overview of Maven and the Flexmojos plugin.

Publicado en: Tecnología
  • Sé el primero en comentar

Wonderful World of Maven

  1. 1. MAVENthe Wonderful World of Maven and Flexmojos
  2. 2. 1. definition
  3. 3. More than just a build tool -Maven is project management.
  4. 4. It’s built in Java and lives under the Apache umbrella, (∴ still new to Flex developers)
  5. 5. it promotes convention over configuration
  6. 6. and, it is hierarchical.
  7. 7. Everything builds via a Project Object Model (POM): aka the blueprint.
  8. 8. A build generates one or more artifacts. (Typically one artifact per POM)
  9. 9. Artifacts are classified by groupId,artifactId, packaging (type) and version.
  10. 10. Versions stamped with SNAPSHOT are treated as such.
  11. 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]
  12. 12. 2. building
  13. 13. A goal is a single action.
  14. 14. A phase is a collection of goals. [M:M]
  15. 15. A lifecycle is a sequence of phases (upto & including).
  16. 16. The odd couple: clean & install. > mvn clean install
  17. 17. The packaging (eg. SWF, SWC, JAR) typically defines the goals within each phase.
  18. 18. In general, the default lifecycle involves the following phases:■ validate■ compile■ test■ package■ integration-test■ verify■ install■ deploy
  19. 19. In addition, plugins provide goals and can bind them to phases. eg. > mvn compiler:compile compiler:testCompile
  20. 20. Plugins include compiler, install, scm, release, javadoc, eclipse, flexmojos, etc.
  21. 21. 3. dependencies
  22. 22. Dependencies are hosted in repositories.
  23. 23. Each install of Maven has a repository. (~/.m2 is your new best friend).
  24. 24. In order to add new dependencies to your repository, you can simply > mvn install:install-file
  25. 25. You add references to repositories either in your POM or in your settings.xml file.
  26. 26. When building, if a dependency is missing, Maven will try to download it from an upstream repository.
  27. 27. As a last resort, it will check Maven Central (search.maven.org).
  28. 28. How are dependencies shared across repositories? Nexus.
  29. 29. Nexus allows an organisation to share artifacts both internally and externally.
  30. 30. It has out-of-the-box support for both snapshot and release repositories.
  31. 31. So, what about dependencies on teh internez?
  32. 32. Nexus will proxy to other external Nexus repositories.
  33. 33. If the dependency isn’t hosted - there’s a 3rd Party repo that you can upload into.
  34. 34. 4. the flexmojos plugin
  35. 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. 36. Goals bound to the default SWF and SWC lifecycles
  37. 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. 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. 39. #2. Add repo location of Flex SDK.http://repository.sonatype.org/content/groups/flexgroup
  40. 40. #3. Build.mvn clean install
  41. 41. #4.Import Maven project into Flashbuilder
  42. 42. #5.Check project settings - source folders, compiler and config.
  43. 43. #6.Setup Maven build and debug as required.
  44. 44. Tip: Only check in /src and your POM - everything else can be generated.
  45. 45. 5. fin
  46. 46. Don’t skim the conventions.Learn the basics and save yourself hours of endless frustration.
  47. 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

×