SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
Email   lcycenter@gmail.com
}    Maven2
}    Maven2
}    Maven2
}    Maven2
      ◦ 
      ◦ 
      ◦ 
      ◦ 
      ◦ 
}         Maven2
      ◦  Maven2
      ◦  Maven2     Ant
      ◦  Maven2           Ant
} 
      ◦ 
      ◦ 
      ◦          Eclipse/Netbean/IntelliJ IDEA/…
      ◦                 maven
} 
      ◦ 
           –     ->     ->   ->        ->
      ◦  ANT
      ◦      ANT
      ◦ 
           –  Tomcat/Jetty
           – 
           – 
} 
}         &
      ◦     JAR
      ◦ 
} 
      ◦    IDE
      ◦ 
} 
} 
} 

} 
}    (Goals)
}    (archetype)
groupId:artifactId:packaging:version
pom.xml
Project1

           pom.xml



Project2

            pom.xml




Project3
}               public / private / locale / …
}    Maven
      ◦            (POM.xml + JAR/WAR)
      ◦             Maven
      ◦  /<groupId>/<artifactId>/<version>/<artifactId>-
         <version>.<packaging>
       –  org.apache.commons:commons-email:1.1
       –  /org/apache/commons/commons-email/1.1/
}    mvn install
}    Maven
      ◦  http://repository.sonatype.org/index.html
      ◦  http://www.mvnbrowser.com/
      ◦  http://www.mvnrepository.com/
<dependencies>
 <dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>3.8.1</version>
  <scope>test</scope>
 </dependency>                     Scope
</dependencies>                    • compile
                                   • provided
}                                 • test
}               JAR               • runtime
                                   • system
validate                  validate the project is correct and all necessary information is
                          available.
generate-sources          generate any source code for inclusion in compilation

process-sources           process the source code, for example to filter any values

generate-resources        generate resources for inclusion in the package.

process-resources         copy and process the resources into the destination directory,
                          ready for packaging.
compile                   compile the source code of the project.

process-classes           post-process the generated files from compilation, for
                          example to do bytecode enhancement on Java classes.
generate-test-sources     generate any test source code for inclusion in compilation

process-test-sources      process the test source code, for example to filter any values.

generate-test-resources   create resources for testing.
process-test-           copy and process the resources into the test destination directory.
resources
test-compile            compile the test source code into the test destination directory

test                    run tests using a suitable unit testing framework. These tests
                        should not require the code be packaged or deployed
package                 take the compiled code and package it in its distributable format,
                        such as a JAR.
pre-integration-test    perform actions required before integration tests are executed. This
                        may involve things such as setting up the required environment.
integration-test        process and deploy the package if necessary into an environment
                        where integration tests can be run.
post-integration-test   perform actions required after integration tests have been executed.
                        This may including cleaning up the environment
verify                  run any checks to verify the package is valid and meets quality
                        criteria.
install                 install the package into the local repository, for use as a
                        dependency in other projects locally.
deploy                  done in an integration or release environment, copies the final
                        package to the remote repository for sharing with other developers
                        and projects.
} 
}    Maven =   +
} 

} 




                $mvn jar:jar
                $mvn archetype:create …
}  mvn compile
}  mvn clean
}  mvn test

}  mvn package
}  mvn install

}  Mvn jetty:run
}  mvn javadoc:javadoc
}  mvn site

}  …
}    Maven2
}    Maven2
}    Maven2
}         Maven   apache-maven-2.1.0-bin.zip
}    2.
        %DEV_HOME%tools
}  3.            M2_HOME %DEV_HOME%
    toolsapache-maven-2.1.0
}  4.            M2: %M2_HOME%bin
}  5.  %M2%       Path
}  6.     CMD          c:mvn --version
}    Maven2
}    Maven2
}    Maven2
}       Builds
}       Documentation
}    Reporting
}       Dependencies
}       SCMs
}       Releases
}    Maven2
      ◦  EAR
      ◦  WAR
      ◦  JAR
      ◦  ZIP
      ◦  EJB
} 
}    mvn archetype:create -
      DgroupId=com.mycompany.ap -
      DartifactId=my-app
      ◦ 
           –  -DgroupId=
           –  -DartifactId=
src/main/java        Application/Library sources
src/main/resources   Application/Library resources
src/main/webapps     Web application sources
src/test/java        Test sources
src/test/resources   Test resources
src/site             Site
LICENSE.txt          Project's license
README.txt           Project's readme
} 
}    Maven2

} 
} 
}                    ebiz-app
}        Java Package      com.xxxx.ebiz
} 
      ◦  app-util(jar):
      ◦  app-dao(jar): model / dao / ibatis
      ◦  app-web-common(jar)
      ◦  app-web-portal(war):
      ◦  app-web-console(war):
}        Plugin    m2eclipse
} 
      ◦ 
      ◦  Coding
      ◦  mvn test
      ◦  mvn jetty:run
      ◦  Code Checkin
      ◦  mvn package
      ◦  mvn install
}  mvn   compile
}  mvn   test
}  mvn   package
}  mvn   install
}  mvn   jetty:run

Más contenido relacionado

La actualidad más candente

Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Puppet
 
jbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scriptingjbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scriptingRed Hat Developers
 
Automated Infrastructure Testing
Automated Infrastructure TestingAutomated Infrastructure Testing
Automated Infrastructure TestingRanjib Dey
 
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and JenkinsContinuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and JenkinsMarcel Birkner
 
Ship your Scala code often and easy with Docker
Ship your Scala code often and easy with DockerShip your Scala code often and easy with Docker
Ship your Scala code often and easy with DockerMarcus Lönnberg
 
Jabox presentation
Jabox presentationJabox presentation
Jabox presentationspiddy
 
Continous delivery with sbt
Continous delivery with sbtContinous delivery with sbt
Continous delivery with sbtWojciech Pituła
 
Building scala with bazel
Building scala with bazelBuilding scala with bazel
Building scala with bazelNatan Silnitsky
 
How to push to production a project with 100+ plugins in less than 10 minutes
How to push to production a project with 100+ plugins in less than 10 minutes How to push to production a project with 100+ plugins in less than 10 minutes
How to push to production a project with 100+ plugins in less than 10 minutes Thiago Leão Moreira
 
Jazoon12 355 aleksandra_gavrilovska-1
Jazoon12 355 aleksandra_gavrilovska-1Jazoon12 355 aleksandra_gavrilovska-1
Jazoon12 355 aleksandra_gavrilovska-1Netcetera
 
State of the Jenkins Automation
State of the Jenkins AutomationState of the Jenkins Automation
State of the Jenkins AutomationJulien Pivotto
 
Jenkins and Groovy
Jenkins and GroovyJenkins and Groovy
Jenkins and GroovyKiyotaka Oku
 
JavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as codeJavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as codeBert Jan Schrijver
 
Testing the Enterprise layers, with Arquillian
Testing the Enterprise layers, with ArquillianTesting the Enterprise layers, with Arquillian
Testing the Enterprise layers, with ArquillianVirtual JBoss User Group
 
Containerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and JavaContainerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and JavaJadson Santos
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Carlos Sanchez
 
Jenkins days workshop pipelines - Eric Long
Jenkins days workshop  pipelines - Eric LongJenkins days workshop  pipelines - Eric Long
Jenkins days workshop pipelines - Eric Longericlongtx
 

La actualidad más candente (20)

Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
 
jbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scriptingjbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scripting
 
SBT Crash Course
SBT Crash CourseSBT Crash Course
SBT Crash Course
 
Automated Infrastructure Testing
Automated Infrastructure TestingAutomated Infrastructure Testing
Automated Infrastructure Testing
 
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and JenkinsContinuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
 
Ship your Scala code often and easy with Docker
Ship your Scala code often and easy with DockerShip your Scala code often and easy with Docker
Ship your Scala code often and easy with Docker
 
Jabox presentation
Jabox presentationJabox presentation
Jabox presentation
 
Continous delivery with sbt
Continous delivery with sbtContinous delivery with sbt
Continous delivery with sbt
 
Building scala with bazel
Building scala with bazelBuilding scala with bazel
Building scala with bazel
 
How to push to production a project with 100+ plugins in less than 10 minutes
How to push to production a project with 100+ plugins in less than 10 minutes How to push to production a project with 100+ plugins in less than 10 minutes
How to push to production a project with 100+ plugins in less than 10 minutes
 
Gradle in 45min
Gradle in 45minGradle in 45min
Gradle in 45min
 
Jazoon12 355 aleksandra_gavrilovska-1
Jazoon12 355 aleksandra_gavrilovska-1Jazoon12 355 aleksandra_gavrilovska-1
Jazoon12 355 aleksandra_gavrilovska-1
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
 
State of the Jenkins Automation
State of the Jenkins AutomationState of the Jenkins Automation
State of the Jenkins Automation
 
Jenkins and Groovy
Jenkins and GroovyJenkins and Groovy
Jenkins and Groovy
 
JavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as codeJavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as code
 
Testing the Enterprise layers, with Arquillian
Testing the Enterprise layers, with ArquillianTesting the Enterprise layers, with Arquillian
Testing the Enterprise layers, with Arquillian
 
Containerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and JavaContainerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and Java
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
 
Jenkins days workshop pipelines - Eric Long
Jenkins days workshop  pipelines - Eric LongJenkins days workshop  pipelines - Eric Long
Jenkins days workshop pipelines - Eric Long
 

Destacado

Minäkö johtajaksi
Minäkö johtajaksiMinäkö johtajaksi
Minäkö johtajaksijaluopo
 
Television digital-12131
Television digital-12131Television digital-12131
Television digital-12131Cynthia Correa
 
10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer ExperienceYuan Wang
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting PersonalKirsty Hulse
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanPost Planner
 

Destacado (8)

Minäkö johtajaksi
Minäkö johtajaksiMinäkö johtajaksi
Minäkö johtajaksi
 
Television digital-12131
Television digital-12131Television digital-12131
Television digital-12131
 
Web 2.0
Web 2.0Web 2.0
Web 2.0
 
Viena 2184
Viena 2184Viena 2184
Viena 2184
 
10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
 
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job? Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media Plan
 

Similar a Maven2交流

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
 
Learning Maven by Example
Learning Maven by ExampleLearning Maven by Example
Learning Maven by ExampleHsi-Kai Wang
 
Java Builds with Maven and Ant
Java Builds with Maven and AntJava Builds with Maven and Ant
Java Builds with Maven and AntDavid Noble
 
Java build tools
Java build toolsJava build tools
Java build toolsSujit Kumar
 
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
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new buildIgor Khotin
 
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java AppsWebinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java AppsCodefresh
 
Introduction To Maven2
Introduction To Maven2Introduction To Maven2
Introduction To Maven2Shuji Watanabe
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenMert Çalışkan
 
Introduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsIntroduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsSISTechnologies
 
maven
mavenmaven
mavenakd11
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - ExplainedSmita Prasad
 
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
 

Similar a Maven2交流 (20)

Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
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
 
Maven
MavenMaven
Maven
 
Liferay maven sdk
Liferay maven sdkLiferay maven sdk
Liferay maven sdk
 
Learning Maven by Example
Learning Maven by ExampleLearning Maven by Example
Learning Maven by Example
 
Java Builds with Maven and Ant
Java Builds with Maven and AntJava Builds with Maven and Ant
Java Builds with Maven and Ant
 
Java build tools
Java build toolsJava build tools
Java build tools
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
Apache Maven
Apache MavenApache Maven
Apache Maven
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new build
 
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java AppsWebinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
 
Introduction To Maven2
Introduction To Maven2Introduction To Maven2
Introduction To Maven2
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with Maven
 
Introduction to maven
Introduction to mavenIntroduction to maven
Introduction to maven
 
Introduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsIntroduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOps
 
maven
mavenmaven
maven
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - Explained
 
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
 
Maven
MavenMaven
Maven
 

Maven2交流

  • 1. Email lcycenter@gmail.com
  • 2. }  Maven2 }  Maven2 }  Maven2
  • 3. }  Maven2 ◦  ◦  ◦  ◦  ◦  }  Maven2 ◦  Maven2 ◦  Maven2 Ant ◦  Maven2 Ant
  • 4. }  ◦  ◦  ◦  Eclipse/Netbean/IntelliJ IDEA/… ◦  maven }  ◦  –  -> -> -> -> ◦  ANT ◦  ANT ◦  –  Tomcat/Jetty –  –  } 
  • 5. }  & ◦  JAR ◦  }  ◦  IDE ◦ 
  • 6.
  • 7.
  • 8.
  • 9. }  }  }  }  }  (Goals) }  (archetype)
  • 11. pom.xml Project1 pom.xml Project2 pom.xml Project3
  • 12. }  public / private / locale / … }  Maven ◦  (POM.xml + JAR/WAR) ◦  Maven ◦  /<groupId>/<artifactId>/<version>/<artifactId>- <version>.<packaging> –  org.apache.commons:commons-email:1.1 –  /org/apache/commons/commons-email/1.1/ }  mvn install }  Maven ◦  http://repository.sonatype.org/index.html ◦  http://www.mvnbrowser.com/ ◦  http://www.mvnrepository.com/
  • 13. <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> Scope </dependencies> • compile • provided }  • test }  JAR • runtime • system
  • 14.
  • 15. validate validate the project is correct and all necessary information is available. generate-sources generate any source code for inclusion in compilation process-sources process the source code, for example to filter any values generate-resources generate resources for inclusion in the package. process-resources copy and process the resources into the destination directory, ready for packaging. compile compile the source code of the project. process-classes post-process the generated files from compilation, for example to do bytecode enhancement on Java classes. generate-test-sources generate any test source code for inclusion in compilation process-test-sources process the test source code, for example to filter any values. generate-test-resources create resources for testing.
  • 16. process-test- copy and process the resources into the test destination directory. resources test-compile compile the test source code into the test destination directory test run tests using a suitable unit testing framework. These tests should not require the code be packaged or deployed package take the compiled code and package it in its distributable format, such as a JAR. pre-integration-test perform actions required before integration tests are executed. This may involve things such as setting up the required environment. integration-test process and deploy the package if necessary into an environment where integration tests can be run. post-integration-test perform actions required after integration tests have been executed. This may including cleaning up the environment verify run any checks to verify the package is valid and meets quality criteria. install install the package into the local repository, for use as a dependency in other projects locally. deploy done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.
  • 17. }  }  Maven = + }  }  $mvn jar:jar $mvn archetype:create …
  • 18.
  • 19. }  mvn compile }  mvn clean }  mvn test }  mvn package }  mvn install }  Mvn jetty:run }  mvn javadoc:javadoc }  mvn site }  …
  • 20. }  Maven2 }  Maven2 }  Maven2
  • 21. }  Maven apache-maven-2.1.0-bin.zip }  2. %DEV_HOME%tools }  3. M2_HOME %DEV_HOME% toolsapache-maven-2.1.0 }  4. M2: %M2_HOME%bin }  5. %M2% Path }  6. CMD c:mvn --version
  • 22. }  Maven2 }  Maven2 }  Maven2
  • 23. }  Builds }  Documentation }  Reporting }  Dependencies }  SCMs }  Releases
  • 24. }  Maven2 ◦  EAR ◦  WAR ◦  JAR ◦  ZIP ◦  EJB
  • 25. }  }  mvn archetype:create - DgroupId=com.mycompany.ap - DartifactId=my-app ◦  –  -DgroupId= –  -DartifactId=
  • 26.
  • 27. src/main/java Application/Library sources src/main/resources Application/Library resources src/main/webapps Web application sources src/test/java Test sources src/test/resources Test resources src/site Site LICENSE.txt Project's license README.txt Project's readme
  • 28. }  }  Maven2 }  } 
  • 29. }  ebiz-app }  Java Package com.xxxx.ebiz }  ◦  app-util(jar): ◦  app-dao(jar): model / dao / ibatis ◦  app-web-common(jar) ◦  app-web-portal(war): ◦  app-web-console(war):
  • 30.
  • 31. }  Plugin m2eclipse }  ◦  ◦  Coding ◦  mvn test ◦  mvn jetty:run ◦  Code Checkin ◦  mvn package ◦  mvn install
  • 32.
  • 33. }  mvn compile }  mvn test }  mvn package }  mvn install }  mvn jetty:run