maven4dummies_ppt

April 4, 2018 | Author: pkv80345 | Category: Software, Software Engineering, Software Development, Technology, Computing


Comments



Description

Maven project automation for dummies Aino Andriessen AMIS  dec 20, 2007 1 Continuous Integration  Continuous integration is the practice where the work of all the developers are integrated, analyzed and verified on a regular basis, preferably multiple times a day. It takes the latest situation from the source control system, performs unit tests, makes a build, deploys the application, performs integration tests and creates reports about these steps and communicates them with the team, all automatically without human interaction.  dec 20, 2007 2 Conditions   Infrastructure  Scripting  No IDE  dec 20, 2007 3 Scripting   Maven  ant  make  shell scripts  sql scripts  ...  dec 20, 2007 4 Demo   dec 20, 2007 5 ....... SUCCESS [3...Maven execution info  [INFO] Scanning for projects.........maven..............org/maven2/junit/junit/3.... SUCCESS [0.......................................866s] HR1 viewController ....8.312s] ----------------------------------------------------------------------------------------------------------------------------------------------BUILD SUCCESSFUL -----------------------------------------------------------------------Total time: 1 minute 20 seconds Finished at: Fri Jun 01 17:32:01 CEST 2007 Final Memory: 10M/18M ----------------------------------------------------------------------- dec 20.....................451s] HR1 ear ........1......... SUCCESS [14........................ [INFO] Reactor build order: [INFO] HR1 [INFO] HR1 model [INFO] HR1 viewController [INFO] HR1 ear [INFO] HR1 integration [INFO] ------------------------Downloading: http://repo1......8. SUCCESS [7............ SUCCESS [54..............................1/junit-3..............jar 118K downloaded [INFO] [INFO] [INFO] [INFO] [INFO] [INFO] [INFO] [INFO] [INFO] [INFO] [INFO] [INFO] [INFO] [INFO] [INFO] [INFO] [INFO] -----------------------------------------------------------------------Reactor Summary: -----------------------------------------------------------------------HR1 ....... 2007 6 .591s] HR1 integration ....003s] HR1 model ................. Failures: 0.046 sec Running nl.queries. Time elapsed: 0. Errors: 0. Errors: 0.adf.queries.model.demo.odtug.amis. Skipped: 0.config.LocationsViewTest Tests run: 1. Errors: 0.EmployeesViewTest Tests run: 1.odtug.queries. Errors: 0. Errors: 0.amis.test.amis.mvn test  [INFO] [surefire:test] [INFO] Surefire report directory: D:\projects\myprojects\odtugDemo\hr1\model\tar get\surefire-reports ------------------------------------------------------TESTS ------------------------------------------------------Running nl. Time elapsed: 2.demo. Errors: 0.odtug.fwk.xml found Tests run: 1.JobsViewTest Tests run: 1.model.OdtugTstViewTest Jun 1. Skipped: 0. Failures: 0. Failures: 0.amis. Time elapsed: 0. Errors: 0.odtug. Failures: 0.adf. Skipped: 0.odtug. Skipped: 0.demo. Skipped: 0.031 sec Running nl.queries.queries. Failures: 0.015 sec Running nl. Errors: 0.CountriesViewTest Tests run: 1.016 sec Running nl.amis.odtug.demo. Time elapsed: 0. Skipped: 0.ADFConfigFactory findOrCreateADFC onfig INFO: oracle.model.amis. Errors: 0. 2007 7 .demo. 2007 7:04:22 PM oracle.demo.606 sec Running nl.model. Failures: 0. Time elapsed: 0.ADFConfigFactory No META-INF/adf-config.queries.Java5Test Tests run: 1.config.015 sec Results : Tests run: 8.queries. Skipped: 0  dec 20.odtug. Failures: 0.amis.model.adf.016 sec Running nl. Time elapsed: 0.share. Failures: 0.model.amis. Skipped: 0.demo.DepartmentsViewTest Tests run: 1.share.032 sec Running nl.model.RegionsViewTest Tests run: 1. Time elapsed: 0. Skipped: 0. Failures: 0. Time elapsed: 0. 2007 8 .demo.4] to[commons-logging-1.war] [INFO] Copying artifact[jar:log4j:log4j:1.0SNAPSHOT.0-SNAPSHOT.MF .2.0SNAPSHOT.Generating one [INFO] Building jar: D:\projects\myprojects\odtugDemo\hr1\ear\target\hr1-ear-1.mvn package  [INFO] Building HR1 [INFO] task-segment: [package] [INFO] --------------------------[INFO] [jar:jar] [INFO] Building jar: D:\projects\myprojects\odtugDemo\hr1\model\target\hr1-model-1.12] to[log4j-1.amis.jar [INFO] ------------------------------------------------------------------------[INFO] [war:war] [INFO] Building war: D:\projects\myprojects\odtugDemo\hr1\viewController\target\hr1-viewController-1.0-SNAPSHOT] to[hr1-viewController-1.jar] [INFO] Could not find manifest file: D:\projects\myprojects\odtugDemo\hr1\ear\src\main\application\METAINF\MANIFEST.2.odtug.jar] [INFO] Copying artifact[jar:commons-logging:commons-logging:1.hr1:hr1-viewController:1.0.ear [INFO] -------------------------------------------------------------------------  dec 20.12.war [INFO] [ear:ear] [INFO] Copying artifact[war:nl.0-SNAPSHOT.4.0. webapp...0-SNAPSHOT [INFO] [INFO] 07/06/01 17:21:31 Notification ==>Binding web application(s) to site default-web-site ends. 2007 9 .. Operation time: 8273 msecs  dec 20. [INFO] [INFO] 07/06/01 17:21:22 Notification ==>Copy the archive to :\server\oc4j_101310\j2ee\home\applications\hr1. [INFO] [INFO] 07/06/01 17:21:24 Notification ==>Initialize hr1-viewController-1.0-SNAPSHOT begins...faces. [INFO] [INFO] 07/06/01 17:21:31 Notification ==>Application Deployer for hr1 COMPLETES. [INFO] [INFO] 07/06/01 17:21:24 Notification ==>Initialize hr1-viewController-1. [INFO] [INFO] 07/06/01 17:21:24 Notification ==>Started application : hr1 [INFO] [INFO] 07/06/01 17:21:24 Notification ==>Binding web application(s) to site default-web-site begins...ear begins.ear [INFO] [INFO] 07/06/01 17:21:22 Notification ==>Initialize C:\server\oc4j_101310\j2ee\home\applications\hr1.FacesServlet for web application hr1-viewController-1..0-SNAPSHOT ends. [INFO] [INFO] 07/06/01 17:21:22 Notification ==>Application Deployer for hr1 STARTS. [INFO] [INFO] 07/06/01 17:21:24 Notification ==>Binding hr1-viewController-1...mvn exec:exec -PlocalOC4J  [INFO] [exec:exec] [[INFO] 07/06/01 17:21:22 Notification ==>Uploading file hr1.0-SNAPSHOT web-module for application hr1 to site default-web-site under context root /hr1 [INFO] [INFO] 07/06/01 17:21:31 Notification ==>Initializing Servlet: javax..ear .. 2007 10 .mvn verify -PlocalOC4J   dec 20. 2007 11 .demo.hr1:hr1-model:1.171522-4.0-SNAPSHOT/hr1-model-1.odtug.amis.mvn deploy  [INFO] [deploy:deploy] [INFO] Retrieving previous build number from ATAMaven2SnapshotsRepo Uploading: file:\\amis-test-aa\maven2snapshots/nl/amis/demo/odtug/hr1/hr1-model/1.jar 50K uploaded [INFO] Retrieving previous metadata from ATAMaven2SnapshotsRepo [INFO] Uploading repository metadata for: 'snapshot nl.0-SNAPSHOT' [INFO] -------------------------------------------------------------------------  dec 20.020070601. 2007 12 .mvn site   dec 20. 2007 13 .Build automation server   dec 20. Demo Summary   ADF Faces application  Tasks       Unittesting Make a build Deploy ear file to OC4J Perform integrationtests Share artifacts Share information  Without manual intervention and JDeveloper !  dec 20. 2007 14 . 2007 15 .Infrastructure   dec 20. Software Studio   dec 20. 2007 16 . Software development          The development environment Source control Delivery environments Issue management Library management Build automation / continuous integration Reporting and documentation Communication  dec 20. 2007 17 . 2007 18 .nl:8080/continuum/servlet/continuum  dec 20.amis.Nightly build   Continuum  Scheduler  http://ci. 'Scripting' with Maven   dec 20. 2007 19 . . 2007 20 ..  dec 20.Maven  Project Object Model  Project objects  xml file Build Lifecycle  actions / goals (tasks)  Dependency (library. artifact) Management  Reporting and Documentation  .  Convention over configuration  dec 20. 2007 21 . jspx</url> <organization> <name>AMIS Services</name> <url>http://www.hr1</groupId> <artifactId>hr1</artifactId> <version>1.POM example  <project> <modelVersion>4.amis.nl/jira/browse/PAG</url> </issueManagement>  dec 20.0-SNAPSHOT</version> <packaging>pom</packaging> <modules> <module>model</module> <module>viewController</module> <module>ear</module> </modules> <name>HR1</name> <description>This application manages employees and general company information.demo.amis.0.odtug. 2007 22 .</description> <url>http://localhost:8800/hr1/faces/index.nl</url> </organization> <issueManagement> <system>Jira</system> <url>http://dev.0</modelVersion> <groupId>nl.amis. amis.amis.nl/users/aino_a/hr1/trunk/ </developerConnection> <url>http://subversion. 2007 23 .andriessen</id> <name>Aino Andriessen</name> <email>aino.nl\maven2</url> </repository> </distributionManagement>  dec 20.POM example  <scm> <connection>scm:svn:http://subversion.amis.nl</email> <organization>AMIS</organization> <roles><role>developer</role></roles> <timezone>+1</timezone> </developer> </developers> <distributionManagement> <repository> <id>AMISMaven2Repo</id> <url>file:\\[email protected]/users/aino_a/hr1/trunk/ </connection> <developerConnection> scm:svn:http://subversion.amis.nl/users/aino_a/hr1/trunk/</url> </scm> <developers> <developer> <id>aino. plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <configuration> <configLocation> src/main/resources/amis_checkstyle.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.maven.maven.6</target> </configuration> </plugin> </plugins> </build> <reporting> <plugins> <plugin> <groupId>org.Pom Example  <build> <plugins> <plugin> <groupId>org.xml </configLocation> </configuration> </plugin> </plugins> </reporting> </project>  dec 20.apache. 2007 24 .6</source> <target>1.apache. build etc. test. package. 2007 25 .Build Lifecycle   Organized sequence of phases like compile. The actual work is done by goals which are bound to a certain phase.  Configuration (if necessary) in pom  Other lifecycles  clean  site validate generate-sources process-sources generate-resources process-resources compile process-classes generate-test-sources process-test-sources generate-test-resources process-test-resources test-compile test prepare-package package pre-integration-test integration-test post-integration-test verify install deploy  dec 20. 2007 26 .Execution   mvn compile  mvn compile:compile  mvn compile:test-compile  mvn package  mvn jar • mvn jar:jar • mvn jar:sign • mvn test-jar:jar  dec 20. ant  dec 20. 2007 27 .Plugins   All 'tasks' are plugins  Written in java. adf</groupId> <artifactId>adfbinding</artifactId> <version>10.odtug.8.84</version> <scope>provided</scope> </dependency> <dependency> <groupId>nl.39.1.amis. 2007 28 .hr1</groupId> <artifactId>hr1-model</artifactId> <version>${project.3.demo.Dependency Management   Defined in the POM  Downloaded from repository when needed  Stored in local repository <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.oracle.version}</version> </dependency> </dependencies>  dec 20.1</version> <scope>test</scope> </dependency> <dependency> <groupId>com. 2007 29 .Maven repositories   dec 20. maven.Maven repositories 2   Local  Internal  Central  http://repo1..  dec 20..net  .org/maven2/  External  Codehaus  java. 2007 30 . Internal repository   commercial libraries  non-public libraries  company products  dec 20. 2007 31 . AMIS internal repositories   http://ci.amis.amis.nl/maven2/  http://ci. 2007 32 .nl/maven2snapshots/  dec 20. amis.jdbc -DartifactId=ojdbc14 -Dversion=10.jar -Dpackaging=jar -DrepositoryId=AMISMaven2Repository -Durl=file:\\ci.1 -Dfile=ojdbc14.oracle.Deploy   Upload the (created) artifact to the internal repository  mvn deploy:deploy-file  deploy a library tot the repository call mvn deploy:deploy-file -DgroupId=com.0. 2007 33 .2.nl\maven2  dec 20. Snapshots   Dependency management for development 'releases'.  dec 20. 2007 34 . 2007 35 .  dec 20...Testing   Unittests  JUnit  TestNG  Integration tests  Database tests  . Integration tests   Start application server  Prepare the database  Deploy application  Run tests  Undeploy application  Stop application server  dec 20. 2007 36 . 2007 37 .Integration tests   Front-end  Selenium  JMeter  Back-end / Database  QCTO  utPLSQL  Tools     dbunit Maven sql plugin Maven exec plugin (JDeveloper) ant tasks  dec 20. 2007 38 .Release   mvn release:prepare  update version  tag in scm  mvn release:perform  deploy tagged version • • • artifact sources doc  create and deploy file  dec 20. amis.nl/projectsites/  dec 20. 2007 39 .Maven projectsites   Documentation  Project info  Reports  http://ci. Maven 'bits and pieces'   Reports  Profiles  Archetype  Cargo plugin  Multi module projects  .  dec 20. 2007 40 ... ADF & JDeveloper & Maven   dec 20. 2007 41 . 2007 42 .Mavenize an ADF application   Dependency management  Crete or generate POM files  Tools  dec 20. 2007 43 .Tools   admin_client.jar utility  deployment to OC4J  ojspc.jar utility  pre compilation of jsf files  [JDeveloper]  [oc4j]  dec 20.  as long as you stay in JDeveloper  as long as you use the provided libraries  dec 20.. 2007 44 ..JDeveloper library management   JDeveloper has a great library management system. 3.jar -Dpackaging=jar -DrepositoryId=%REPO_ID% -Durl=%REPO_URL% <dependencies> <dependency> <groupId>com. 2007 45 .adf -DartifactId=adfshare -Dversion=%ADF_VERSION% -Dfile=%JDEV_HOME%/BC4J/lib/adfshare.adf</groupId> <artifactId>adfshare</artifactId> <version>10.oracle.57</version> <scope>provided</scope> </dependency> </dependencies>  dec 20.oracle.1.Dependencies   Put (deploy) libraries in the internal repository  Keep pom file(s) in sync call mvn deploy:deploy-file -DgroupId=com.41. jdev-cm. bc4jmt.73 10. bc4jhtml. bc4jdatum.1. adfui. sqlj runtime  JDeveloper • oc4j-internal.1. xmlparserv2. adfbinding. bc4jct.57  dec 20.66 10.3.3 10. graphtags. adf-faces-api.1.1.3. adf-faces-impl.41.Required libraries   ADF • • adfshare.1. 2007 JDev 46 . ojmisc.39.3.1 10. ojsp. ojsputil  Other • sun collections 1.1. bc4jdomorcl.2 10.1. bc4jimdomains.40. apache commons  Note : do NOT include log4j ADF 10. datatags.84 10. ordim jhsadfrt. adf-controller. adfm.0 10.3.1. oc4j.3.3.36.3.3.1. 2007 47 .Application / Project organisation   Directory layout  Default Maven layout  JDev project settings  Application with multiple projects  dec 20. nl/maven2(snapshots) -DgroupId=nl.3[-SNAPSHOT] -DremoteRepositories=http://ci.amis.ADF Archetype   AMIS maven-archetype-adf : mvn archetype:create -DarchetypeGroupId=nl.maven.demo -DartifactId=hr1  dec 20.amis.amis.3. 2007 48 .1.archetypes -DarchetypeArtifactId=maven-archetype-adf -DarchetypeVersion=10. apache.nl/blog/?p=1279  dec 20.2.Trinidad JDev plugin  org.5  Execute : mvn jdev:jdev  http://technology.amis.Projectfile generation   Create jws and jpr files  myFaces . 2007 49 .trinidadbuild.maven-jdevplugin  version 1.myfaces. xml  dec 20.Deploy to OC4J   Command-line  oc4j admin_client. 2007 50 . cargo:deploy  Define local dependencies (location of admin_client.jar utility  in ear project or associated with a certain phase  mvn exec:exec -PlocalOC4J  Unfortunately no Cargo plugin  cargo:start.jar) in local settings. cargo:stop. port> <id>deployApp</id> <ias.url}</argument> <argument>${ias.password}</argument> <argument>-deploy</argument> <argument>-file</argument> <argument>.adminclient.port>8888</ias.password> </properties> <goal>exec</goal> </profile> </goals>   <configuration> <executable>${java.server.codehaus.mojo</groupId> <activeByDefault>false</activeByDefault> <artifactId>exec-maven-plugin</artifactId> </activation> <properties> <executions> <ias.url>ci.url> <execution> <ias.username> <goals> <ias.server.deploy.url>deployer:oc4j:${ias.password>oc4jadmin</ias..Example <profile> <id>devOC4J</id> <plugin> <activation> <groupId>org.deploy.home}/bin/java</executable> <arguments> <argument>-jar</argument> <argument>${oc4j.server.deploy.server.url> <phase>pre-integration-test</phase> <ias.ear -deploymentName hr1 -bindAllWebApps dec 20.ear</argument> <argument>-deploymentName</argument> <argument>hr1</argument> <argument>-bindAllWebApps</argument> </arguments> </configuration> java -jar C:\server\oc4j_101310\j2ee\home\admin_client./ear/target/hr1-ear-${version}.jar</argument> <argument>${ias.home}\j2ee\home\admin_client.amis.username>oc4jadmin</ias.username}</argument> <argument>${ias.0-SNAPSHOT.url}</ias.server. 2007 51 .jar </execution> deployer:oc4j:localhost </executions> oc4jadmin oc4jadmin </plugin> -deploy -file hr1-ear-1.nl</ias. Running Maven from JDeveloper   Waiting for a JDeveloper extension . 2007 52 .-)  Ant tasks as wrapper  dec 20. xml  <M2_HOME>/conf/ or <user. 2007 oc4j installation 53 .Installation of Maven   http://maven.m2/  [local repository]  servers • credentials  internal repositories  local configurations •  dec 20.apache.dir>/. PATH  mvn -verify  settings.org/download.html  Unzip  Environment settings : M2_HOME . Nieuw Caledonië  dec 20.Conclusion   Continuous integration is essential for the development process!  Using Maven. Locatus. ADF Faces applications can be continuously integrated!  Maven succesfully applied at Connexys. 2007 54 . Pagoni. 2007 55 .nl http://technology.andriessen@amis. aino.amis.nl/blog  dec 20.
Copyright © 2024 DOKUMEN.SITE Inc.