Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Enterprise Web App. Development (1): Build Tool...

Enterprise Web App. Development (1): Build Tool Training Ver. 4

This is the updated version of the first course of a series of the courses for Enterprise Web Application development based on several Open Source products. As open source development tools, we are going to take care of Apache Maven as a build tool, Git as a version control tool and JUnit5 as a test tool. After then, we are going into the Jakarta EE framework. Therefore this series requires the basic skills of Windows 10, Rocky Linux 9.1, Eclipse IDE, Java SE (Oracle JDK, Open JDK), Payara Server and PostgreSQL. Regarding the Payara Server, we can use another Web Application Server conforming to Jakarta EE specification. As for PostgreSQL, we might be able to use another RDBMS product instead. We can also make use of another Linux distribution instead of Rocky Linux.

Koichi NAKAGAWA

March 05, 2021
Tweet

More Decks by Koichi NAKAGAWA

Other Decks in Programming

Transcript

  1. BUILD TOOL (VER. 4) A part of the Open Source

    Development Tool Courses Using Apache Maven™ with M2Eclipse™ Eclipse™ Plug-in 1 By Koichi NAKAGAWA Enterprise Web Application Development Course (1)
  2. Update Information • Ver. 4 : Use Rocky Linux™ 9.1,

    OpenJDK 17 and Artifactory OSS™ 7.55.8 in all exercises. • Ver. 3: Use Rocky Linux™ instead of CentOS™ as a Linux platform for JFrog Artifactory OSS™ and changed the way of installation of JFrog Artifactory OSS™. • Ver. 2 : Use JDK 11 instead of JDK 8 in all exercises and replace Apache Archiva™ with JFrog Artifactory OSS™ because Apache Archiva™ does not support JDK 11. 2
  3. EWA development course curriculum Object Oriented Development Methodology JSF with

    CDI JPA + JTA with CDI JAX-RS Application Architecture Design Patterns Eclipse IDE™ Version Control Tool with Git™ Build Tool with Apache Maven™ Payara Server™ Administration Windows 10™ + Linux (Rocky Linux™) Total EWA Development Exercise Jakarta Batch Java SE (Oracle JDK™/OpenJDK™) Required Skills to take courses Test Tool with JUnit5 PostgreSQL™ Administration 4
  4. Open Source Development Tools • Build Tool (Apache Maven™ with

    Eclipse™ Plug-in) • Version Control Tool (Git™ with Eclipse™ Plug-in) • Test Tool (JUnit5 with Eclipse™ Plug-in) 5
  5. Trademarks Notice • Apache Maven, Maven and the Maven logo(

    ) are trademarks of the Apache Software Foundation (ASF). • Apache Ant, Ant and the Ant logo( ) are trademarks of the Apache Software Foundation (ASF). • JFrog Artifactory OSS, Artifactory OSS, Artifactory and the Artifactory logo( ) are trademarks of the JFrog Ltd. • Eclipse IDE for Enterprise Java Developers™, the Eclipse IDE for Enterprise Java Developers™ logo( ) are trademarks of the Eclipse Foundation. • Eclipse M2Eclipse™, M2Eclipse™ is trademark of the Eclipse Foundation. • Java™ is trademark of Oracle Corporation. 6
  6. Assumption for this course • The trainees who take this

    course are required the following skills in advance • Oracle JDK/OpenJDK (Version: 17) • Eclipse IDE for Enterprise Java Developers (Version: 2023-03 (4.27.0)) 7
  7. Objectives of Build Tool Course • Learning the Apache Maven™

    Build Tool, you will obtain the concepts of build tool and how to operate it through M2Eclipse™ Eclipse™ plug-in for Apache Maven™. Additionally you will know how to set up the internal Maven repository environment using JFrog Artifactory OSS™ and how to use it. 8
  8. Apache Maven™ Build Tool • Concepts • POM (Project Object

    Model) • M2Eclipse™ Eclipse Plug-in • JForg Artifactory OSS™ Enterprise Universal Repository Manager • Exercise 9
  9. Open Source Build Tools History • Historical Build Tools make

    Unix Standard Build Tool which provides “Build Automation” and “Dependency Management” between target module and required source files. Apache Ant™ Initial Java Standard Build Tool which implements the concepts similar to Unix Standard Build Tool, make tool, but using XML configuration file. Apache Maven™ Advanced Java Standard Build Tool which implements the concept of “Convention over Configuration” and the “Library Management with Automatic Download” feature. Configuration File Makefile build.xml pom.xml 11
  10. Convention over Configuration • Different Approach between Apache Ant™ and

    Apache Maven™ <target name=“init”> <mkdir dir=“target/classes”/> </target> <target name=“compile” depends=“init”> <javac srcdir=“src/main/java” destdir=“target/classes”/> </target> <target name=“package” depends=“compile”> <jar jarfile=“target/abc-0.1.jar” basedir=“target/classes” /> </target> Ant – build.xml <project> <modelVersion>4.0.0</modelVersion> <groupId>org.xyz</groupId> <artifactId>abc</artifactId> <version>0.1</version> </project> Maven – pom.xml Convention over Configuration 12 a software design paradigm used by software frameworks that attempts to decrease the number of decisions that a developer using the framework is required to make without necessarily losing flexibility. (Source: Wikipedia, https://en.wikipedia.org/wiki/Convention_over_configuration)
  11. Convention over Configuration • Default Build Life Cycle and Standard

    Directory Structure of Apache Maven™ compile test package install deploy Artifact Local Repository Remote Repository src main java resources webapp site test java resources target Default Build Life Cycle Standard Directory Structure 13
  12. Convention over Configuration • Goal and Plugin for each Build

    Life Cycle Phase based on a “packaging” tag in pom.xml compile test package install deploy Default Build Life Cycle Phase compile maven-compiler-plugin maven-surefire-plugin test maven-jar-plugin jar maven-install-plugin install maven-deploy-plugin deploy Goal Plugin 14
  13. Convention over Configuration • Example of actual phases, goals, plug-ins

    and tasks for a “jar” packaged artifact Phase Goal Plug-In Task process-resources resource maven-resources-plugin • Copy “src/main/resources” to “target/classes” compile compile maven-compiler-plugin • Compile java source files under “src/main/java” and put the class files under “target/classes” process-test-resources testResourceses maven-resources-plugin • Copy “src/test/resources” to “target/test-classes” test-compile testCompile maven-compiler-plugin • Compile test cases under “src/test/java” and put the class files under “target/test-classes” test test maven-surefire-plugin • Execute compiled test cases and put the outcome under “target/surefire-reports” package jar maven-jar-plugin • Generate the target project package and put it under “target/classes” install install maven-install-plugin • Put the generated package to the local repository deploy deploy maven-deploy-plugin • Put the generated package to the remote repository 15
  14. Library Management with Automatic Download • Automatic Download of Required

    Library Modules Application abc-0.1.jar aaa-2.1.1.jar bbb-5.2.jar <project> : <dependencies> <dependency> <groupId>org.xyz</groupId> <artifactId>abc</artifactId> <version>0.1</version> <scope>test</scope> </dependency> </dependencies> : </project> . . . . . . Maven– pom.xml Local Repository org xyz abc-0.1.jar internet Central Repository Automatic Download at “test” phase 16
  15. Project Object Model (pom.xml) • pom.xml: Maven Project File (XML)

    (1) <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>model version</modelVersion> <groupId>group id</groupId> <artifactId>artefact id</artifactId> <version>version</version> <packaging>package type</packaging> : </project> POM version (Currently only “4.0.0” is supported) Artifact Id (Project Name: a part of the target package) Group Id (Unique Id among an organization or a project) Version (Project Version: a part of the target package) Package Format like “jar”(default), “war”, “ear”, “pom” 18
  16. Exercise for Project Object Model (1) • Project Folder/Local Repository

    Example based on Standard Maven Task Flow Local Repository com xyz apptest-0.0.1.jar compile install Project Folder src main java (com.xyz) App.java target classes (com.xyz) App.class package Project Folder src main java (com.xyz) App.java target apptest- 0.0.1.jar classes (com.xyz) App.class 19 Exercise: Let’s make a pom.xml for the above example.
  17. Exercise for Project Object Model (1) • pom.xml: Maven Project

    File (XML) (1) Example <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.xyz</groupId> <artifactId>apptest</artifactId> <version>0.0.1</version> <packaging>jar</packaging> : </project> 20
  18. Project Object Model (pom.xml) • pom.xml: Maven Project File (XML)

    (2) - Properties <project xmlns="http://maven.apache.org/POM/4.0.0" … > : <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> : <maven.compiler.source>17</maven.compiler.source> <maven.compiler.target>17</maven.compiler.target> : <dummy>dummy-value</dummy> : </properties> : </project> maven-compiler-plugin This value can be referred as ${dummy} in pom.xml The JDK version A character encoding scheme like “UTF-8”, “UTF-16”, “ASCII” to read and write files with plug-ins 21
  19. Project Object Model (pom.xml) • pom.xml: Maven Project File (XML)

    (3) – Artifact Dependency Management <project xmlns="http://maven.apache.org/POM/4.0.0" … > : <dependencies> : <dependency> <groupId>group id</groupId> <artifactId>artifact id</artifactId> <version>version</version> <type>package type</type> <scope>scope</scope> </dependency> : </dependencies> : </project> Packaging type (default: jar) Dependent artifact is specified. 22
  20. Exercise for Project Object Model (2) • Artifact Dependency Example

    of automatic downloaded artifact in Local Repository Central Repository junit junit-4.12.jar internet Local Repository junit junit-4.12.jar <dependencies> : <dependency> <groupId>?</groupId> <artifactId>?</artifactId> <version>?</version> <type>?</type> <scope>test</scope> </dependency> : </dependencies> 23 Exercise: Let’s make a pom.xml for the above example.
  21. Exercise for Project Object Model (2) • Artifact Dependency Example

    of automatic downloaded artifact in Local Repository Central Repository junit junit-4.12.jar internet Local Repository junit junit-4.12.jar <dependencies> : <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <type>jar</type> <scope>test</scope> </dependency> : </dependencies> 24
  22. Project Object Model (pom.xml) • pom.xml: Maven Project File (XML)

    (3) – Artifact Dependency Management (<scope>) When? Scope Compile Test Execution compile (default)    provided   runtime   test  system   <scope> in <dependency> indicates when the dependent module is added to classpath. Show if the dependent module is included in the artifact. (Example) Jakarta EE container modules. (Example) JRE system modules. 25
  23. Project Object Model (pom.xml) • pom.xml: Maven Project File (XML)

    (3) – Artifact Dependency Management (<scope>) compile provided runtime test compile compile runtime provided provided provided runtime runtime runtime test test test <scope> in <dependency> also indicates how to deal with “Transitive Dependency”. Artifact B Artifact A Project runtime (“Transitive Dependency”) compile runtime 26 Artifact A’s Scope for Project Artifact B’s Scope for Artifact A
  24. Project Object Model (pom.xml) • pom.xml: Maven Project File (XML)

    (3) – Artifact Dependency Management (<version>) 1.0 : “Soft” requirement on 1.0 [1.0] : “Hard” requirement on 1.0 [1.0,) : x >= 1.0 (,1.0] : x <= 1.0 [1.0, 2.0] : 1.0 <= x <= 2.0 [1.0, 2.0) : 1.0 <= x < 2.0 (,1.0],[2.0,) : x <= 1.0 or x >= 2.0 (,1.1),(1.1,) : Exclude 1.1 <version> in <dependency> also indicates which version of dependent module is used. “alpha” < “beta” < “milestone” < “rc” = “cr” < “SNAPSHOT” < “” = “final” = “ga” < “sp” Ex. “1.ga” = “1.final” “1-alpha-1” < “1-SNAPSHOT” 27
  25. Exercise for Project Object Model (3) • Artifact Dependency Example

    of <scope> and <version> Target Project org.abc.helloApp Project org.xyz.byeApp Project Direct Dependency Scope: compile Version: 2.53 Only Direct Dependency Scope: runtime Version: >= 3.4 Dependency for Project What Scope? When Used? WhichVersion? Example Artifact org.abc.helloApp compile Compile/Test/Execution 2.53 Only org.abc.helloApp_2.53.jar org.xyz.byeApp runtime Test/Execution X >= 3.4 org.xyz.byeApp_5.6.jar Target Project is dependent on the following artifacts Transitively Dependency Scope: runtime Version: >= 3.4 <dependency> <groupId>?</groupId> <artifactId>?</artifactId> <version>?</version> <type>?</type> <scope>?</scope> </dependency> <dependency> <groupId>?</groupId> <artifactId>?</artifactId> <version>?</version> <type>?</type> <scope>?</scope> </dependency> 28 Exercise: Let’s make the <dependency> tags for the Target and helloApp Projects.
  26. Exercise for Project Object Model (3) • Artifact Dependency Example

    of <scope> and <version> <dependency> <groupId>org.abc</groupId> <artifactId>helloApp</artifactId> <version>[2.53]</version> <type>jar</type> <scope>compile</scope> </dependency> < Target Project> <dependency> <groupId>org.xyz</groupId> <artifactId>byeApp</artifactId> <version>[3.4,)</version> <type>jar</type> <scope>runtime</scope> </dependency> < helloApp Project> Target Project helloApp Project byeApp Project Direct Dependency Compile scope Direct Dependency Runtime scope Transitive Dependency Runtime scope 29
  27. Project Object Model (pom.xml) • pom.xml: Maven Project File (XML)

    (4) – Inheritance Several projects can share the configuration of their parent’s pom. Parent POM Child POM #1 Child POM #2 Child POM #3 <project … > <modelVersion> 4.0.0 </modelVersion> <group>…</group> <artifactId>…</artifactId> <version>…</version> <packaging>pom</packaging> (Common Elements) and (Elements to configure values) </project> ex. <dependencyManagement> <project … > <modelVersion> 4.0.0 </modelVersion> <parent> <group>…</group> <artifactId>…</artifactId> <version>…</version> <relativePath>../my-parent</relativePath> </parent> </project> Super POM my-parent (Relative Path to Parent Project directory from Child Projects) /projects/my-parent/pom.xml < Parent POM> /projects/child1/pom.xml /projects/child2/pom.xml /projects/child3/pom.xml < Child POMs> 30
  28. Exercise for Project Object Model (4) • pom packaging Inheritance

    Example Several projects can share the configuration of their parent’s pom. Super POM Parent POM Child POM Depend on “org.abc.helloApp-2.53.jar” in “compile” scope Depend on “com.xyz.abcxyz-1.21.jar” in “compile” scope com.xyz.my-parent-5.2.pom /projects/my-parent/pom.xml < Parent POM> /projects/my-project/pom.xml < Child POM> Shared Part Specific Part com.xyz.my-project-1.1.jar 31 Exercise: Let’s make 2 pom.xml for the Parent and Child Projects.
  29. Exercise for Project Object Model (4) • pom packaging Inheritance

    Example using <parent> and <relative-path> <project … > <modelVersion> 4.0.0 </modelVersion> <group>com.xyz</group> <artifactId>my-parent</artifactId> <version>5.2</version> <packaging>pom</packaging> <dependencies> <dependency> <groupId>org.abc</groupId> <artifactId>helloApp</artifactId> <version>2.53</version> <type>jar</type> <scope>compile</scope> </dependency> </dependencies> </project> <project … > <modelVersion> 4.0.0 </modelVersion> <group>com.xyz</group> <artifactId>my-project</artifactId> <version>1.1</version> <parent> <group>com.xyz</group> <artifactId>my-parent</artifactId> <version>5.2</version> <relativePath>../my-parent</relativePath> </parent> <dependencies> <dependency> <groupId>com.xyz</groupId> <artifactId>abcxyz</artifactId> <version>1.21</version> <type>jar</type> <scope>compile</scope> </dependency> </dependencies> </project> Shared Part < Parent POM> < Child POM > Specific Part Parent POM 32
  30. Project Object Model (pom.xml) • pom.xml: Maven Project File (XML)

    (5) – Aggregation Parent POM comprises multiple Child POMs. Parent POM Child POM #1 Child POM #2 Child POM #3 <project … > <modelVersion> 4.0.0 </modelVersion> <group>…</group> <artifactId>…</artifactId> <version>…</version> <packaging>pom</packaging> <modules> <module>my-project</module> <module>another-project</module> <module>third-project</module> </modules> </project> my-project another-project third-project (The Child POM directory paths relative to the Parent POM directory) /projects/pom.xml /projects/my-project/pom.xml /projects/another-project/pom.xml /projects/third-project/pom.xml < Parent POM> < Children POM> 33
  31. Exercise for Project Object Model (5) • pom packaging Aggregation

    Example Parent POM comprises multiple Child POMs. Parent POM Child POM #1 Child POM #2 Child POM #3 my-project another-project third-project Depend on “com.xyz.another-project-2.21.jar” in “compile” scope /projects/pom.xml /projects/my-project/pom.xml /projects/another-project/pom.xml /projects/third-project/pom.xml < Parent POM> < Children POM> com.xyz.my-parent-5.2.pom com.xyz.my-project-1.1.jar 34 Exercise: Let’s make 2 pom.xml for the Parent and Child Projects. com.xyz.another-project-2.21.jar com.xyz.third-project-5.34.jar
  32. Exercise for Project Object Model (5) • pom packaging Aggregation

    Example using <modules> and <module> <project … > <modelVersion> 4.0.0 </modelVersion> <group>com.xyz</group> <artifactId>my-parent</artifactId> <version>5.2</version> <packaging>pom</packaging> <modules> <module>my-project</module> <module>another-project</module> <module>third-project</module> </modules> </project> <project … > <modelVersion> 4.0.0 </modelVersion> <group>com.xyz</group> <artifactId>my-project</artifactId> <version>1.1</version> <dependencies> <dependency> <groupId>com.xyz</groupId> <artifactId>another-project</artifactId> <version>2.21</version> <type>jar</type> <scope>compile</scope> </dependency> </dependencies> </project> Children Definition < Parent POM> < Child POM #1 (my-project) > Dependency to another child 35
  33. Project Object Model (pom.xml) • pom.xml: Maven Project File (XML)

    (6) – Build and Profile <build> is used to change default Maven behaviors or add some behaviors. <profile> is used to define multiple customized configurations in a pom.xml file. <project … > <modelVersion> 4.0.0 </modelVersion> <group>com.xyz</group> <artifactId>my-project</artifactId> <version>1.4</version> <build> … </build> <profiles> <profile> <build> … </build> </profile> : </profiles> </project> Project Build 36 Profile Definitions Multiple <profile> definitions in pom.xml pom.xml Profile A (Deploy war file to Local WAS) Profile B (Deploy war file to Remote WAS) Profile X . . .
  34. Exercise for Project Object Model (6) • Example changing a

    default behavior of Maven to change artifact file name <project> <modelVersion> 4.0.0 </modelVersion> <groupId>com.xyz</groupId> <artifactId>projectA</artifactId> <version>2.3</version> <packaging>war</packaging> : </project> Actual File Name: projectA.war Maven Default File Name: projectA-2.3.war 37 Exercise: Let’s make a pom.xml for the above example.
  35. Exercise for Project Object Model (6) • Example changing a

    default behavior of Maven using <build> and <finalName> <project> <modelVersion> 4.0.0 </modelVersion> <group>com.xyz</group> <artifactId>projectA</artifactId> <version>2.3</version> <packaging>war</packaging> <build> <finalName>projectA</finalName> </build> </project> Actual File Name: projectA.war Maven Default File Name: projectA-2.3.war 38
  36. M2Eclipse™ • M2Eclipse™(Maven Plug-in for Eclipse IDE) M2Eclipse™ is a

    Maven Plug-in for Eclipse IDE and bundled into Eclipse IDE for Enterprise Java and Web Developers™ 40
  37. M2Eclipse™ • M2Eclipse™(Maven Plug-in for Eclipse IDE) Eclipse IDE for

    Enterprise Java Developer™ PC Local Repository internet Central Repository M2Eclipse™ M2Eclipse™ takes care of most of Maven operations including automatic downloading from Central Repository, installing to Local Repository. 41
  38. How to use M2Eclipse™? • Procedures to develop a Maven

    Project with M2Eclipse™ Make Maven Project Test Project Test Case Build Project Package Run Project Application 42
  39. • What’s Archetype?  Archetype generates pom.xml, Maven Directory Structure

    with some files to be used as templates  Developer selects an Artifact from Archetype Catalogs for specific Maven Project Type How to use M2Eclipse™ Make Maven Project 43 src main java resources webapp site test java resources pom.xml pom.xml and Maven Directory Structure Archetype Generate Archetype Catalogs Select Artifact
  40. Exercise with M2Eclipse™ • Sample procedures to develop a Maven

    Project with M2Eclipse™ on Eclipse IDE Create Maven Project - Group Id: org.example - Artifact Id: simple - Version: 0.0.1 - Type: jar Make Maven Project Test Project Test Case Build simple-0.0.1.jar package Build Project Package Execute org.example.simple App.java Execute JUnit for org.example.simple AppTest.java Run Project Application org.apache.maven.archetypes maven-archetype-simple ver1.4 Archetype 44 Exercise: Let’s make a Maven project following the above sample procedure.
  41. • Create a new workplace named “ws1” 1. After executing

    Eclipse™, click “File  Switch Workspace  Other…”. 2. “Select a directory as a workspace” pane screen comes up and click “Browse…”. 3. “Select Workspace Directory” dialog menu comes up and create a new workspace folder named “ws1” by clicking “New folder” button and select it as Workspace and click “Select Folder”. 4. Click “Launch” button on “Select a directory as a workspace” pane screen and Eclipse is restarted with the new workplace. Exercise with M2Eclipse™ 45
  42. • Configure Installed JRE (1) 1. Select “Window  Preferences”

    and “Preferences” dialog screen comes up. 2. Select “Java  Installed JREs” and click “Add …” button on “Installed JREs” pane screen. Exercise with M2Eclipse™ 46 If JDK 17 is already selected as “Installed JRE”, skip this step.
  43. • Configure Installed JRE (2) 3. Select “Standard VM” and

    click “Next >” button and “Add JRE” dialog screen comes up. 4. Click “Directory …” button and select an installed JDK home directory and click “Finish” button on “JRE Definition” pane screen. Exercise with M2Eclipse™ 47 If JDK 17 is already selected as “Installed JRE”, skip this step.
  44. • Configure Installed JRE (3) 5. Select the added JDK

    entry from “Installed JREs” and click “Apply and Close” button on “Installed JREs” pane screen. Exercise with M2Eclipse™ 48 If JDK 17 is already selected as “Installed JRE”, skip this step.
  45. • Sample Procedure to make a simple Maven project with

    M2Eclipse™ (1) In Project Explore, click the “Create a Maven project” link. Exercise with M2Eclipse™ Make Maven Project 49
  46. • Sample Procedure to make a simple Maven project with

    M2Eclipse™ (2) On “New Maven project” pane screen, check “Use default Workplace location” and click “Next >” button. Exercise with M2Eclipse™ Make Maven Project 50
  47. • (Option) Sample Procedure to make a simple Maven project

    with M2Eclipse™ (3) Click “Configure…” button next to “Catalog” field, if “maven-archetype-simple (Ver. 1.4)” does NOT exist in the Archetype list. Otherwise, skip this step and next a few steps. Exercise with M2Eclipse™ Make Maven Project If “maven-archetype-simple (Ver. 1.4)” already exists, skip this step. 51
  48. • (Option) Sample Procedure to make a simple Maven project

    with M2Eclipse™ (4) Click “Add Remote Catalog …” next to “Catalog” field on “Archetypes” pane screen. Exercise with M2Eclipse™ Make Maven Project 52 If “maven-archetype-simple (Ver. 1.4)” already exists, skip this step.
  49. • (Option) Sample Procedure to make a simple Maven project

    with M2Eclipse™ (5) Enter “http://repo.maven.apache.org/maven2/archetype-catalog.xml” as “Catalog File” and “Remote Catalog” as “Description” and click “OK” button on “Remote Archetype Catalog” pane screen. Exercise with M2Eclipse™ Make Maven Project 53 If “maven-archetype-simple (Ver. 1.4)” already exists, skip this step.
  50. • (Option) Sample Procedure to make a simple Maven project

    with M2Eclipse™ (6) Click “Apply and Close” button on “Archetypes” pane screen. Exercise with M2Eclipse™ Make Maven Project 54 If “maven-archetype-simple (Ver. 1.4)” already exists, skip this step.
  51. • Sample Procedure to make a simple Maven project with

    M2Eclipse™ (7) From “Select an Archetype” dialog menu, select “Remote Catalog” or “All Catalogs” in “Catalog” field and search for “org.apache.maven.archetypes maven-archetype-simple 1.4” and select it and click “Next >” button on “New Maven project” pane screen. Exercise with M2Eclipse™ Make Maven Project 55
  52. • Sample Procedure to make a simple Maven project with

    M2Eclipse™ (8) On “New Maven project” pane screen, enter “org.example” in “Group Id” field and “simple” in “Artifact Id” field and “0.0.1” in “Version” field and click “Finish” button. Exercise with M2Eclipse™ Make Maven Project 56
  53. • Sample Procedure to make a simple Maven project with

    M2Eclipse™ (9) Enter “Y” in the Eclipse IDE console pane. Exercise with M2Eclipse™ Make Maven Project 57
  54. • Sample Procedure to make a simple Maven project with

    M2Eclipse™ (10) Confirm that the following Maven project “simple” was created successfully. After that, change compiler version to “17” Exercise with M2Eclipse™ Make Maven Project 17 58
  55. • Sample Procedure to make a simple Maven project with

    M2Eclipse™ (11) Modify the App.java of package “org.example.simple” under “src/main/java” folder like the followings. Exercise with M2Eclipse™ Make Maven Project App.java AppTest.java Add 59
  56. • Sample Procedure to make a simple Maven project with

    M2Eclipse™ (12) 1. Right click on “simple” project and select “Maven”  “Update Project …” 2. On “Update Maven Project” pane screen, select “simple” Codebase and click “OK” button. 3. Confirm the version of “JRE System Library” was changed to “JavaSE-17” Exercise with M2Eclipse™ Make Maven Project 60
  57. • Sample Procedure to test the simple Maven project with

    JUnit (1) In Project Explorer, right click on the “simple” project and select “Run As”  “2 JUnit Test” Exercise with M2Eclipse™ Test Project Test Case 61
  58. • Sample Procedure to test the simple Maven project with

    JUnit (2) Confirm that “Green Flag” is shown in “JUnit” pane screen, which means JUnit finished successfully. Exercise with M2Eclipse™ Test Project Test Case 62
  59. • Sample Procedure to build the simple Maven project with

    M2Eclipse™ (1) Right click on “simple” project and select “Run As”  “3 Maven Build”. Exercise with M2Eclipse™ Build Project Package 63
  60. • Sample Procedure to build the simple Maven project with

    M2Eclipse™ (2) Enter “Package simple” in “Name” field and “clean package” in “Goal” field and click “Run” button on “Edit configuration and launch” pane screen. Exercise with M2Eclipse™ Build Project Package 64
  61. • Sample Procedure to build the simple Maven project with

    M2Eclipse™ (3) Confirm the “BUILD SUCCESS” message on ”Console” pane screen. Exercise with M2Eclipse™ Build Project Package 65
  62. • Sample Procedure to build the simple Maven project with

    M2Eclipse™ (4) Confirm the result of JUnit from the outputs under “target\surefire-reports” folder. Exercise with M2Eclipse™ Build Project Package 66
  63. • Sample Procedure to execute the simple Maven project (1)

    Right click on “simple” project and select “Run As”  “1 Java Application”. Exercise with M2Eclipse™ Run Project Application 67
  64. • Sample Procedure to execute the simple Maven project (2)

    On “Select Java Application” dialog screen, select “App – org.example.simple” and click “OK” button Exercise with M2Eclipse™ Run Project Application 68
  65. • Sample Procedure to execute the simple Maven project (3)

    Confirm that the result is shown successfully like below on “Console” pane screen. Exercise with M2Eclipse™ Run Project Application 69
  66. JFrog Artifactory OSS™ • JFrog Artifactory OSS™: Enterprise Universal Repository

    Manager Eclipse IDE for Enterprise Java Developer™ PC JFrog Artifactory OSS™ Cached Internal Repository Local Repository Server internet Central Repository Eclipse IDE for Enterprise Java Developer™ PC Local Repository . . M2Eclipse™ M2Eclipse™ 71
  67. Team Development • Team Development with JFrog Artifactory OSS™ Development

    Team A (xxx.jar) Development Team B (yyy.jar) Development Team C (zzz.war) JFrog Artifactory OSS™ Internal Repository Server deploy deploy deploy pull pull pull - xxx.jar - yyy.jar - zzz.war Depend Depend 72
  68. Installation with Linux™ Archive Installation with Docker™ Installation with others

    • Docker Compose™ • Debian™ • Helm™ • RPM™ • Mac (Darwin)™ • Windows™ Docker™ Container Installation of JFrog Artifactory OSS™ • Many ways to install JFrog Artifactory OSS™ JFrog Artifactory OSS™ Derby™ Database Linux OS (Rocky Linux™) Tomcat™ Web App Server JFrog Artifactory OSS™ Derby™ Database Tomcat™ Web App Server Install Artifactory OSS™ with Linux™ Archive 73 Linux OS (Rocky Linux™)Install ArtifactoryOSS™ inside a Docker Container
  69. Development with JFrog Artifactory OSS™ • Configurations to make use

    of JFrog Artifactory OSS™ from M2Eclipse™ Configuration File settings.xml pom.xml Location $HOME/.m2/settings.xml $PROJECT/pom.xml Role Common Part of Maven Configuration for all projects Project Specific Part of Maven Configuration for a project Descriptions How to retrieve artifacts from Artifactory™ -Release Artifacts from RELEASES Repository -Snapshot Artifacts from SNAPSHOTS Repository -Plug-in Artifacts from RELEASES Repository How to deploy artifacts to Artifactory™ -Release Artifacts to RELEASES Repository -Snapshot Artifacts to SNAPSHOTS Repository M2Eclipse™ JFrog Artifactory OSS™ RELEASES Repository SNAPSHOTS Repository - Release Artifacts - Plug-in Artifacts - Snapshot Artifacts 74 Central Repository
  70. How to install and configure JFrog Artifactory OSS™? • Procedures

    to make use of JFrog Artifactory OSS™ 7.55.8 Installation of JFrog Artifactory OSS™ Configure Fetch Configure Deployment 75
  71. Installation of JFrog Artifactory OSS™ • How to install JFrog

    Artifactory OSS™ If “netstat” command has not been available on your Rocky Linux™ yet, try the followings. 1. Install net-tools rpm package # dnf install net-tools Procedure to install JFrog Artifactory OSS™ 7.55.8 on Single Node of Rocky Linux™ 9.1 (Preparation) Installation of JFrog Artifactory OSS™ 76 2.Install nginx-release rpm:# rpm -Uvh trinity-repo*rpm 3.Install trinity-knetstats rpm package:# dnf install trinity-knetstats
  72. Installation of JFrog Artifactory OSS™ • How to install JFrog

    Artifactory OSS™ 1. Download JFrog Artifactory OSS™ 7.55.8 Linux Archive file, jfrog-artifactory-oss-7.55.8-linux.tar.gz, from https://jfrog.com/community/download-artifactory-oss/ and put it into “/opt” directory. 2. Create a JFrog home directory and extract the Archive file there. #cd /opt #mkdir jfrog #mv jfrog-artifactory-oss-7.55.8-linux.tar.gz jfrog/ #cd jfrog #tar xvf jfrog-artifactory-oss-7.55.8-linux.tar.gz #mv artifactory-oss-7.55.8 artifactory 3. Create a user for Artifactory and set the ownership to all the extracted files #useradd artifactory #chown -R artifactory:artifactory artifactory Procedure to install JFrog Artifactory OSS™ 7.55.8 on Single Node of Rocky Linux™ 9.1 (1) Installation of JFrog Artifactory OSS™ 77
  73. Installation of JFrog Artifactory OSS™ • How to install JFrog

    Artifactory OSS™ 4. Setup the Artifactory as a service #cd artifactory #./app/bin/installService.sh #chown -R artifactory:artifactory /opt/jfrog/artifactory #cp /usr/lib/systemd/system/artifactory.service /etc/system/system/ #chmod -x /etc/systemd/system/artifactory.service #systemctl daemon-reload (If you want it to get auto-started at boot time of Rocky Linux™, execute the following command.) #systemctl enable artifactory.service 5. Start the Artifactory service #systemctl start artifactory.service 6. Configure firewall #firewall-cmd --add-port=8082/tcp #firewall-cmd --runtime-to-permanent Procedure to install JFrog Artifactory OSS™ 7.55.8 on Single Node of Rocky Linux™ 9.1 (2) Installation of JFrog Artifactory OSS™ 78
  74. Installation of JFrog Artifactory OSS™ • How to install JFrog

    Artifactory OSS™ If “TIMEOUT” error happens while starting Artifactory Service, try the followings. 1. Modify the timeout value of Artifactory Service in the Artifactory system YAML file #vi /opt/jfrog/artifactory/var/etc/system.yaml Add the following lines at the end of this file. 2. Modify the timeout value of systemd Service Unit file #vi /etc/systemd/system/artifactory.service #systemctl daemon-reload 3. Reboot system #systemctl reboot Procedure to install JFrog Artifactory OSS™ 7.55.8 on Single Node of Rocky Linux™ 9.1 (Option) Installation of JFrog Artifactory OSS™ 79 ## Script Configuration ## Parameters for the application startup scripts script: ## The max time to wait for Tomcat to come up (START_TMO) #serviceStartTimeout: 60 serviceStartTimeout: 180 TimeoutStartSec=180  Put under “shared:” section  Put under “[Service]” section Timeout value should be adjusted to your environment
  75. Installation of JFrog Artifactory OSS™ • How to configure JFrog

    Artifactory OSS™ Configuration of JFrog Artifactory OSS™ 7.55.8 80 Installation of JFrog Artifactory OSS™ JFrog Artifactory OSS™ Derby™ Database Linux OS (Rocky Linux™) Tomcat™ Web App Server Users admin (1) developer (8) Groups readers developers (7) Permissions Any Remote (10) Any Local (9) central (2) (Remote Repo.) local-releases (3) (Local Repo.) local-snapshots (4) (Local Repo.) releases (5) (Virtual Repo.) snapshots (6) (Virtual Repo.) Accounts Repos
  76. Installation of JFrog Artifactory OSS™ • How to configure JFrog

    Artifactory OSS™ 1. Set Password and Email Address for “admin” account 1) Access to JFrog Artifactory OSS ™ with a browser at http://<Artifactory Server Host Name>:8082/ui/ 2) Enter “admin” as username and “password” as its password and Click “Login” button 3) Go to “Identity and Access”  “Users” and click on the “admin” link 4) Set “Email” and “Password” of the admin account and click “Save” button 2. Create a Remote Repository for Maven Central Repository 1) Login as admin 2) Go to “Repositories”  “Repositories” and click on the “Add Repositories”  “Remote Repository” menu Then “SELECT PACKAGE TYPE” dialog screen comes up. 3) Select “Maven” as a package type and “New Remote Repository” screen appears 4) Set “central” as “Repository Key”, “https://repo.maven.apache.org/maven2” as “URL” and click “Save & Finish” button Procedure to configure JFrog Artifactory OSS™ 7.55.8 81 Installation of JFrog Artifactory OSS™
  77. Installation of JFrog Artifactory OSS™ • How to configure JFrog

    Artifactory OSS™ 3. Create a Local Repository for Internal RELEASES Repository 1) Login as admin 2) Go to “Repositories”  “Repositories” and click on the “Add Repositories”  “Local Repository” menu Then “SELECT PACKAGE TYPE” dialog screen comes up 3) Select “Maven” as a package type and “New Local Repository” screen appears 4) Set “local-releases” as “Repository Key”, unset “Handle Snapshots” and click “Save & Finish” button 4. Create another Local Repository for Internal SNAPSHOTS Repository 1) Login as admin 2) Go to “Repositories”  “Repositories” and click on the “Add Repositories”  “Local Repository” menu Then “SELECT PACKAGE TYPE” dialog screen comes up 3) Select “Maven” as a package type and “New Local Repository” screen appears 4) Set “local-snapshots” as “Repository Key”, unset “Handle Releases” and click “Save & Finish” button Procedure to configure JFrog Artifactory OSS™ 7.55.8 (Continued) 82 Installation of JFrog Artifactory OSS™
  78. Installation of JFrog Artifactory OSS™ • How to configure JFrog

    Artifactory OSS™ 5. Create a Virtual Repository for Cashed Internal RELEASES Repository 1) Login as admin 2) Go to “Repositories”  “Repositories” and click on the “Add Repositories”  “Virtual Repository” menu Then “SELECT PACKAGE TYPE” dialog screen comes up 3) Select “Maven” as a package type and “New Virtual Repository” screen appears 4) Set “releases” as “Repository Key”, set “local-releases” and “central” as “Selected Repositories” and click “Save & Finish” button 6. Create a Virtual Repository for Cashed Internal SNAPSHOTS Repository 1) Login as admin 2) Go to “Repositories”  “Repositories” and click on the “Add Repositories”  “Virtual Repository” menu Then “SELECT PACKAGE TYPE” dialog screen comes up 3) Select “Maven” as a package type and “New Virtual Repository” screen appears 4) Set “snapshots” as “Repository Key”, set “local-snapshots” and “central” as “Selected Repositories” and click “Save & Finish” button Procedure to configure JFrog Artifactory OSS™ 7.55.8 (Continued) 83 Installation of JFrog Artifactory OSS™
  79. Installation of JFrog Artifactory OSS™ • How to configure JFrog

    Artifactory OSS™ 7. Create a Group called “developers” 1) Login as admin 2) Go to “Identity & Access”  “Groups” and click on the “New Group” link Then “Add New Group” screen comes up 3) Set “developers” as “Group Name”, and click “Save” button 8. Create a User called “developer” who belongs to “developers” and “readers” Groups 1) Login as admin 2) Go to “Identity & Access”  “Users” and click on the “New User” link Then “Add New User” screen comes up 3) Set “developer” as “User Name”, an appropriate Email Address for “Email Address”, an appropriate password for “Password”, add “developers” as “Related Groups”, and click “Save” button Procedure to configure JFrog Artifactory OSS™ 7.55.8 (Continued) 84 Installation of JFrog Artifactory OSS™
  80. Installation of JFrog Artifactory OSS™ • How to configure JFrog

    Artifactory OSS™ Procedure to configure JFrog Artifactory OSS™ 7.55.8 (Continued) 85 Installation of JFrog Artifactory OSS™ 9. Create a Permission and assign it to “developers” Group 1) Login as admin 2) Go to “Identity & Access”  “Permissions” and click on the “New Permission” link Then “Create Permission” screen comes up 3) Set “Any Local” as “Name” and click “Resources” tag and “Add Repositories” link and then “ADD REPOSITORY” screen appears 4) Select “local-releases”, “local-snapshots” as “Included Repositories” and click “OK” button 5) Click “Groups” tag and “Add Groups” button shown as “+” 6) Select “developers” as “Included Groups” and click “OK” button 7) Select “Read”, “Annotate”, “Deploy/Cache” and “Delete/Overwrite” for “Repositories” and click “Create” button
  81. Installation of JFrog Artifactory OSS™ • How to configure JFrog

    Artifactory OSS™ Procedure to configure JFrog Artifactory OSS™ 7.55.8 (Continued) 86 Installation of JFrog Artifactory OSS™ 10. Modify a Permission to include “developers” Group 1) Login as admin 2) Go to “Identity & Access”  “Permissions” and click on the “Any Remote” link from “Permission Target Name” Then “Edit Permission Any Remote” screen comes up 3) Click “Groups” tag and “Add Groups” button shown as “+” 4) Select “developers” as “Included Groups” and click “OK” button 5) Select “Read” and “Deploy/Cache” for “Repositories” and click “Save” button
  82. Maven Configuration for JFrog Artifactory OSS™ • How to configure

    JFrog Artifactory OSS™ account in $HOME/.m2/settings.xml <?xml version="1.0"?> <settings> <servers> <server> <id>repository-releases</id> <username>[User Name]</username> <password>[Password]</password> </server> <server> <id>repository-snapshots</id> <username>[User Name]</username> <password>[Password]</password> </server> </servers> : Define Account to access JFrog Artifactory OSS™ for RELEASES Repository $HOME/.m2/settings.xml Configure Fetch Define Account to access JFrog Artifactory OSS™ for SNAPSHOTS Repository 87
  83. Maven Configuration for JFrog Artifactory OSS™ • How to configure

    JFrog Artifactory OSS™ profile in $HOME/.m2/settings.xml : <profiles> <profile> <id>Repository Proxy</id> <activation> <activeByDefault>true</activeByDefault> </activation> <repositories> … </repositories> <pluginRepositories> … </<pluginRepositories> </profile> </profiles> </settings> $HOME/.m2/settings.xml (Continued) Define a Profile for JFrog Artifactory OSS™ Configure Fetch 88
  84. Maven Configuration for JFrog Artifactory OSS™ • How to configure

    Cached Internal RELEASES Repository in $HOME/.m2/settings.xml <repositories> <repository> <id>repository-releases</id> <name>Artifactory Managed RELEASES Repository</name> <url>http://<Artifactory host name>: 8082/artifactory/releases/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> Retrieve RELEASES version of dependent modules from Cached Internal RELEASES Repository of JFrog Artifactory OSS ™ $HOME/.m2/settings.xml (<repositories> part inside <profile>) Configure $HOME/.m2/settings.xml Configure Fetch 89
  85. Maven Configuration for JFrog Artifactory OSS™ • How to configure

    Cached Internal SNAPSHOTS Repository in $HOME/.m2/settings.xml <repository> <id>repository-snapshot</id> <name>Artifactory Managed Snapshots Repository</name> <url>http://<Artifactory host name>: <port>/repository/snapshots/</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> Retrieve SNAPSHOTS(Under Development) version like <version>1.0-SNAPSHOT</version> of dependent modules from Cached Internal SNAPSHOTS Repository JFrog Artifactory OSS™ $HOME/.m2/settings.xml (<repositories> part) (Continued) Configure $HOME/.m2/settings.xml Configure Fetch 90
  86. Maven Configuration for JFrog Artifactory OSS™ • How to configure

    Cached Internal RELEASES Plug-In Repository in $HOME/.m2/settings.xml <pluginRepositories> <pluginRepository> <id>repository-releases</id> <name>Artifactory Managed RELEASES Repository</name> <url>http://<Artifactory host name>:8082/artifactory/releases/</url> </pluginRepository> </pluginRepositories> Retrieve Plug-In modules from Cached Internal RELEASES Repository on JFrog Artifactory OSS™ $HOME/.m2/settings.xml (<pluginRepositories> part) Configure $HOME/.m2/settings.xml Configure Fetch 91
  87. Selection of fetched repository type • How to fetch from

    Cached Internal RELEASES Repository of JFrog Artifactory OSS™ Server <dependencies> <dependency> <groupId>org.abc</groupId> <artifactId>helloApp</artifactId> <version>2.53</version> <type>jar</type> <scope>compile</scope> </dependency> </dependencies> Retrieve the dependent module from Cached Internal RELEASES Repository of JFrog Artifactory OSS™ Server $PROJECT/pom.xml Configure $HOME/.m2/settings.xml Configure Fetch 92
  88. Selection of fetched repository type • How to fetch from

    Cached Internal SNAPSHOTS Repository of JFrog Artifactory OSS™ Server <dependencies> <dependency> <groupId>org.abc</groupId> <artifactId>helloApp</artifactId> <version>2.53-SNAPSHOT</version> <type>jar</type> <scope>compile</scope> </dependency> </dependencies> Retrieve the dependent module from Cached Internal SNAPSHOTS Repository of JFrog Artifactory OSS™ Server $PROJECT/pom.xml Configure $HOME/.m2/settings.xml Configure Fetch 93
  89. Package Artifact with JFrog Artifactory OSS™ • How to fetch

    artifacts from JFrog Artifactory OSS™ with M2Eclipse™ Right click on project in “Package Explorer” and select “Run As”  “4. Maven Build …”. Configure Fetch 94 compile test package
  90. Maven Configuration for JFrog Artifactory OSS™ • How to configure

    pom.xml for deploying developed artifacts to JFrog Artifactory OSS™ <project> <distributionManagement> <repository> <id>repository-releases</id> <name>Internal RELEASES Repository</name> <url>http://<Artifactory host name>: 8082/artifactory/local-releases/</url> </repository> <snapshotRepository> <id>repository-snapshots</id> <name>Internal SNAPSHOTS Repository</name> <url>http://<Artifactory host name>: 8082/artifactory/local-snapshots/</url> </snapshotRepository > </distributionManagement> </project> Deploy developed SNAPSHOT artifacts to JFrog Artifactory OSS™ Deploy developed RELEASES artifacts to JFrog Artifactory OSS™ $PROJECT/pom.xml Configure Deployment 95 Specify Internal SNAPSHOTS Repository Specify Internal RELEASES Repository
  91. Selection of deployed repository type • How to select Internal

    RELEASES Repository to deploy modules to JFrog Artifactory OSS™ <project …> <modelVersion>4.0.0</modelVersion> <groupId>com.xyz</groupId> <artifactId>apptest</artifactId> <version>0.0.1</version> <packaging>jar</packaging> : </project> Deploy to the Internal RELEASES Repository of JFrog Artifactory OSS™ Server $PROJECT/pom.xml Configure Deployment 96
  92. Selection of deployed repository type • How to select Internal

    SNAPSHOT Repository to deploy modules to JFrog Artifactory OSS™ <project …> <modelVersion>4.0.0</modelVersion> <groupId>com.xyz</groupId> <artifactId>apptest</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> : </project> Deploy to the Internal SNAPSHOTS repository of JFrog Artifactory OSS™ Server $PROJECT/pom.xml Configure Deployment 97
  93. Deploy Artifact with JFrog Artifactory OSS™ • How to deploy

    a developed artifact to JFrog Artifactory OSS™ with M2Eclipse™ Right click on project in “Package Explorer” and select “Run As”  “4. Maven Build …”. compile test package install deploy Configure Deployment 98
  94. Rocky Linux™ 9.1 (Host Name: hostA) Exercise of JFrog Artifactory

    OSS™ Installation JFrog Artifactory OSS™ • Exercise to install JFrog Artifactory OSS™ Server  Install JFrog Artifactory OSS™ 7.55.8 on Rocky Linux™ 9.1 server. 99 Exercise: Let’s install JFrog Artifactory OSS based on the above information. Derby™ Database Tomcat™ Web App Server Installation of JFrog Artifactory OSS™
  95. Exercise of JFrog Artifactory OSS™ Installation • How to install

    JFrog Artifactory OSS™ If “netstat” command has not been available on your Rocky Linux™ yet, try the followings. 1. Install net-tools rpm package # dnf install net-tools Procedure to prepare for installing JFrog Artifactory OSS™ 7.55.8 Server on Rocky Linux™ 9.1 Installation of JFrog Artifactory OSS™ 100
  96. Exercise of JFrog Artifactory OSS™ Installation • How to install

    JFrog Artifactory OSS™ 1. Download JFrog Artifactory OSS™ 7.55.8 Linux Archive file, jfrog-artifactory-oss-7.55.8-linux.tar.gz, from https://jfrog.com/community/download-artifactory-oss/ and put it into “/opt” directory. 2. Create a JFrog home directory and extract the Archive file there. #cd /opt #mkdir jfrog #mv jfrog-artifactory-oss-7.55.8-linux.tar.gz jfrog/ #cd jfrog #tar xvf jfrog-artifactory-oss-7.55.8-linux.tar.gz #mv artifactory-oss-7.55.8 artifactory 3. Create a user for Artifactory and set the ownership to all the extracted files #useradd artifactory #chown -R artifactory:artifactory artifactory Procedure to install JFrog Artifactory OSS™ 7.55.8 Server on Rocky Linux™ 9.1 Installation of JFrog Artifactory OSS™ 101
  97. Exercise of JFrog Artifactory OSS™ Installation • How to install

    JFrog Artifactory OSS™ 4. Setup the Artifactory as a service #cd artifactory #./app/bin/installService.sh #chown -R artifactory:artifactory /opt/jfrog/artifactory #cp /usr/lib/systemd/system/artifactory.service /etc/system/system/ #chmod -x /etc/systemd/system/artifactory.service #systemctl daemon-reload (If you want it to get auto-started at boot time of Rocky Linux™, execute the following command.) #systemctl enable artifactory.service 5. Start the Artifactory service #systemctl start artifactory.service 6. Configure firewall #firewall-cmd --add-port=8082/tcp #firewall-cmd --runtime-to-permanent Procedure to install JFrog Artifactory OSS™ 7.55.8 Server on Rocky Linux™ 9.1 Installation of JFrog Artifactory OSS™ 102
  98. Exercise of JFrog Artifactory OSS™ Installation • How to install

    JFrog Artifactory OSS™ Procedure to install JFrog Artifactory OSS™ 7.55.8 Server on Rocky Linux™ 9.1 (Option) 103 If “TIMEOUT” error happens while starting Artifactory service, try the followings. 1. Modify the timeout value of Artifactory Service in the Artifactory system YAML file #vi /opt/jfrog/artifactory/var/etc/system.yaml Add the following lines under “shared:” section. 2. Modify the timeout value of systemd Service Unit file #vi /etc/systemd/system/artifactory.service #systemctl daemon-reload 3. Reboot system #systemctl reboot ## Script Configuration ## Parameters for the application startup scripts script: ## The max time to wait for Tomcat to come up (START_TMO) #serviceStartTimeout: 60 serviceStartTimeout: 180 TimeoutStartSec=180  Put under “shared:” section  Put under “[Service]” section Installation of JFrog Artifactory OSS™
  99. Exercise of JFrog Artifactory OSS™ Configuration (1) • The 1st

    step: Set initial information like “admin” account Modify the administrator account of “admin” setting its Email Address to [Your Email Address] and changing its Password to [Any Secure password]. 104 Installation of JFrog Artifactory OSS™ Rocky Linux™ 9.1 (Host Name: hostA) JFrog Artifactory OSS™ Derby™ Database Linux OS (Rocky Linux™) Tomcat™ Web App Server Users admin (1) developer (8) Groups readers developers (7) Permissions Any Remote (10) Any Local (9) central (2) (Remote Repo.) local-releases (3) (Local Repo.) local-snapshots (4) (Local Repo.) releases (5) (Virtual Repo.) snapshots (6) (Virtual Repo.) Accounts Repos Exercise: Let’s modify Password and Email Address of the “admin” account.
  100. Exercise of JFrog Artifactory OSS™ Configuration (1) • Set 2

    properties of “admin” account (1) Procedure to modify properties for the administrator account of “admin”. 105 Installation of JFrog Artifactory OSS™ 1. Set Password and Email Address for “admin” account 1) Access to JFrog Artifactory OSS ™ with a browser at “http://hostA:8082/ui/”. 2) Enter “admin” as username and “password” as its password and click “Login” button. 3) Select “User Management” menu and click the link of “admin” user on “Users” pane screen. 4) Enter an “Email Address” for the “admin” user on “Edit user: admin” pane screen. 5) Enter a new “Password” for the “admin” user click “Save” button on “Edit user: admin” pane screen.
  101. Exercise of JFrog Artifactory OSS™ Configuration (1) • Set 2

    properties of “admin” account (2) 106 Installation of JFrog Artifactory OSS™ 3) Select “User Management” menu and click the link of “admin” user on “Users” pane screen.
  102. Exercise of JFrog Artifactory OSS™ Configuration (1) • Set 2

    properties of “admin” account (3) 107 Installation of JFrog Artifactory OSS™ 4) Enter an “Email Address” for the “admin” user on “Edit user: admin” pane screen.
  103. Exercise of JFrog Artifactory OSS™ Configuration (1) • Set 2

    properties of “admin” account (4) 108 Installation of JFrog Artifactory OSS™ 5) Enter a new “Password” for the “admin” user click “Save” button on “Edit user: admin” pane screen.
  104. Exercise of JFrog Artifactory OSS™ Configuration (2) • The 2nd

    step: Make a “central” repository Create a Remote Repository named “central” to point to the Maven 2 central repository. 109 Installation of JFrog Artifactory OSS™ Rocky Linux™ 9.1 (Host Name: hostA) JFrog Artifactory OSS™ Derby™ Database Linux OS (Rocky Linux™) Tomcat™ Web App Server Users admin (1) developer (8) Groups readers developers (7) Permissions Any Remote (10) Any Local (9) central (2) (Remote Repo.) local-releases (3) (Local Repo.) local-snapshots (4) (Local Repo.) releases (5) (Virtual Repo.) snapshots (6) (Virtual Repo.) Accounts Repos Exercise: Let’s create a Remote Repository named “central”.
  105. Exercise of JFrog Artifactory OSS™ Configuration (2) • Create a

    Remote Repository for Maven 2 Central Repository (1) Procedure to make a Remote Repository named “central” pointing to Maven 2 Central Repository 110 Installation of JFrog Artifactory OSS™ Create a Remote Repository for Maven Central Repository 1) Login as admin. 2) Go to “Repositories”  “Repositories” and click on the “Add Repositories” and select “Remote Repository” menu on “Repositories” pane screen. And then “SELECT PACKAGE TYPE” dialog screen comes up. 3) Select “Maven” as a package type and “New Remote Repository” pane screen appears. 4) Set “central” in “Repository Key” field, “https://repo1.maven.org/maven2/” in “URL” field and click “Create Remote Repository” button on “New Remote Repository” pane screen. 5) Confirm on “Repositories” pane screen that 1 remote repository named “central” is successfully created.
  106. Exercise of JFrog Artifactory OSS™ Configuration (2) • Create a

    Remote Repository for Maven 2 Central Repository (2) 111 Installation of JFrog Artifactory OSS™ 2) In “Administration”, select “Repositories”  “Repositories” and click on the “Add Repositories” and “Remote Repository” menu on “Repositories” pane screen. And then “SELECT PACKAGE TYPE” dialog screen comes up.
  107. Exercise of JFrog Artifactory OSS™ Configuration (2) • Create a

    Remote Repository for Maven 2 Central Repository (3) 112 Installation of JFrog Artifactory OSS™ 3) Select “Maven” on “Select Package Type” dialog screen and then “New Remote Repository” pane screen appears.
  108. Exercise of JFrog Artifactory OSS™ Configuration (2) • Create a

    Remote Repository for Maven 2 Central Repository (4) 113 Installation of JFrog Artifactory OSS™ 4) Set “central” in “Repository Key” field, “https://repo1.maven.org/maven2/” in “URL” field and click “Create Remote Repository” button on “New Remote Repository” pane screen. 5) Confirm on “Repositories” pane screen that 1 remote repository named “central” is successfully created.
  109. Exercise of JFrog Artifactory OSS™ Configuration (3) • The 3rd

    & 4th steps: Make 2 Local Repositories Create 2 Local Repositories named “local-releases” and “local-snapshots” for RELEASES and SNAPSHOTS. 114 Installation of JFrog Artifactory OSS™ Rocky Linux™ 9.1 (Host Name: hostA) JFrog Artifactory OSS™ Derby™ Database Linux OS (Rocky Linux™) Tomcat™ Web App Server Users admin (1) developer (8) Groups readers developers (7) Permissions Any Remote (10) Any Local (9) central (2) (Remote Repo.) local-releases (3) (Local Repo.) local-snapshots (4) (Local Repo.) releases (5) (Virtual Repo.) snapshots (6) (Virtual Repo.) Accounts Repos Exercise: Let’s create 2 Local Repositories named “local-releases” and “local-snapshots”.
  110. Exercise of JFrog Artifactory OSS™ Configuration (3) • Create 2

    Local Repositories for Internal RELEASES and SNAPSHOTS Repositories (1) Procedure to make 2 Local Repositories named “local-releases” for Internal RELEASES Repository and “local-snapshots” for Internal SNAPSHOTS Repository 115 Installation of JFrog Artifactory OSS™ 3. Create a Local Repository for Internal RELEASES Repository 1) Login as admin 2) Go to “Repositories”  “Repositories” and click on the “Add Repositories” and select “Local Repository” menu. And then “Select Package Type” dialog screen comes up. 3) Select “Maven” as a package type and “New Local Repository” dialog screen appears 4) Set “local-releases” as “Repository Key”, unset “Handle Snapshots” and click “Create Local Repository” button on “New Local Repository” dialog screen. 5) Confirm on “Repositories” pane screen that the local repository are successfully created. 4. Create another Local Repository for Internal SNAPSHOTS Repository 1) Login as admin. 2) Go to “Repositories”  “Repositories” and click on the “Add Repositories” and select “Local Repository” menu. And then “Select Package Type” dialog screen comes up. 3) Select “Maven” as a package type and “New Local Repository” dialog screen appears. 4) Set “local-snapshots” as “Repository Key”, unset “Handle Releases” and click “Create Local Repository” button on “New Local Repository” dialog screen. 5) Confirm on “Repositories” pane screen that the local repository are successfully created.
  111. Exercise of JFrog Artifactory OSS™ Configuration (3) • Create 2

    Local Repositories for Internal RELEASES and SNAPSHOTS Repositories (2) 116 Installation of JFrog Artifactory OSS™ 2) In “Administration”, select “Repositories”  “Repositories” and click on the “Add Repositories” and select “Local Repository” menu. And then “Select Package Type” dialog screen comes up.
  112. Exercise of JFrog Artifactory OSS™ Configuration (3) • Create 2

    Local Repositories for Internal RELEASES and SNAPSHOTS Repositories (3) 117 Installation of JFrog Artifactory OSS™ 3) Select “Maven” on “Select Package Type” dialog screen and then “New Local Repository” dialog screen appears.
  113. Exercise of JFrog Artifactory OSS™ Configuration (3) • Create 2

    Local Repositories for Internal RELEASES and SNAPSHOTS Repositories (4) 118 Installation of JFrog Artifactory OSS™ 4) Set “local-releases” and “local-snapshots” in “Repository Key” field, unset “Handle Snapshots” for “local-releases” and unset “Handle Releases” for “local-snapshots” and click “Create Local Repository” button on “New Local Repository” dialog screen.  “local-releases”  “local-snapshots”  Unset “Handle Snapshots”  Unset “Handle Releases”
  114. Exercise of JFrog Artifactory OSS™ Configuration (3) • Create 2

    Local Repositories for Internal RELEASES and SNAPSHOTS Repositories (5) 119 Installation of JFrog Artifactory OSS™ 5) Confirm on “Repositories” pane screen that 2 local repositories are successfully created.
  115. Exercise of JFrog Artifactory OSS™ Configuration (4) • The 5th

    & 6th steps: Make 2 Virtual Repositories for Cached Internal RELEASES and SNAPSHOTS Create 2 Virtual Repositories named “releases” and “snapshots” for caching RELEASES and SNAPSHOTS. 120 Installation of JFrog Artifactory OSS™ Rocky Linux™ 9.1 (Host Name: hostA) JFrog Artifactory OSS™ Derby™ Database Linux OS (Rocky Linux™) Tomcat™ Web App Server Users admin (1) developer (8) Groups readers developers (7) Permissions Any Remote (10) Any Local (9) central (2) (Remote Repo.) local-releases (3) (Local Repo.) local-snapshots (4) (Local Repo.) releases (5) (Virtual Repo.) snapshots (6) (Virtual Repo.) Accounts Repos Exercise: Let’s create 2 Virtual Repositories named “releases” and “snapshots”.
  116. Exercise of JFrog Artifactory OSS™ Configuration (4) • Create 2

    Virtual Repositories for Cached Internal RELEASES and SNAPSHOTS Repositories (1) Procedure to make 2 Virtual Repositories named “releases” for Cached Internal RELEASES Repository cached between “local-repositories” and “central” and “snapshots” for Cached Internal SNAPSHOTS Repository cached between “local-snapshots” and “central”. 121 Installation of JFrog Artifactory OSS™ 5. Create a Virtual Repository for Cashed Internal RELEASES Repository 1) Login as admin 2) Go to “Repositories”  “Repositories” and click on the “Add Repositories” and select “Virtual Repository” menu. And then “Select Package Type” dialog screen comes up. 3) Select “Maven” as a package type and “New Virtual Repository” dialog screen appears. 4) Set “releases” as “Repository Key”, set “local-releases” and “central” as “Selected Repositories” and click “Create Virtual Repository” button on “New Virtual Repository” dialog screen. 6. Create a Virtual Repository for Cashed Internal SNAPSHOTS Repository 1) Login as admin. 2) Go to “Repositories”  “Repositories” and click on the “Add Repositories” and select “Virtual Repository” menu. And then “Select Package Type” dialog screen comes up. 3) Select “Maven” as a package type and “New Virtual Repository” screen appears. 4) Set “snapshots” as “Repository Key”, set “local-snapshots” and “central” as “Selected Repositories” and click “Create Virtual Repository” button on “New Virtual Repository” dialog screen.
  117. Exercise of JFrog Artifactory OSS™ Configuration (4) • Create 2

    Virtual Repositories for Cached Internal RELEASES and SNAPSHOTS Repositories (2) 122 Installation of JFrog Artifactory OSS™ 2) In “Administration”, select “Repositories”  “Repositories” and click on the “Add Repositories” and select “Virtual Repository” menu. And then “SELECT PACKAGE TYPE” dialog screen comes up.
  118. Exercise of JFrog Artifactory OSS™ Configuration (4) • Create 2

    Virtual Repositories for Cached Internal RELEASES and SNAPSHOTS Repositories (3) 123 Installation of JFrog Artifactory OSS™ 3) Select “Maven” as a package type on “Select Package Type” dialog screen and “New Virtual Repository” dialog screen appears.
  119. Exercise of JFrog Artifactory OSS™ Configuration (4) • Create 2

    Virtual Repositories for Cached Internal RELEASES and SNAPSHOTS Repositories (4) 124 Installation of JFrog Artifactory OSS™ 4) Set “releases” and “snapshots” as “Repository Key”, set “local-releases” and “central” for “releases” and set “local-snapshots” and “central” for “snapshots” as “Selected Repositories” and click “Create Virtual Repository” button on “New Virtual Repository” dialog screens.  “releases”  “snapshots”  “central” & “releases”  “central” & “snapshots” . . . . . .
  120. Exercise of JFrog Artifactory OSS™ Configuration (4) • Create 2

    Virtual Repositories for Cached Internal RELEASES and SNAPSHOTS Repositories (5) 125 Installation of JFrog Artifactory OSS™ 5) Confirm on “Repositories” pane screen that 2 virtual repositories are successfully created.
  121. Exercise of JFrog Artifactory OSS™ Configuration (5) • The 7th

    step: Make a Group called “developers” Create a Group named “developers” for “developer” User to be created later. 126 Installation of JFrog Artifactory OSS™ Rocky Linux™ 9.1 (Host Name: hostA) JFrog Artifactory OSS™ Derby™ Database Linux OS (Rocky Linux™) Tomcat™ Web App Server Users admin (1) developer (8) Groups readers developers (7) Permissions Any Remote (10) Any Local (9) central (2) (Remote Repo.) local-releases (3) (Local Repo.) local-snapshots (4) (Local Repo.) releases (5) (Virtual Repo.) snapshots (6) (Virtual Repo.) Accounts Repos Exercise: Let’s create a Group named “developers”.
  122. Exercise of JFrog Artifactory OSS™ Configuration (5) • Create a

    Group named “developers” for “developer” User (1) Procedure to make a Group named “developers” for “developer” User to be created later. 127 Installation of JFrog Artifactory OSS™ Create a Group called “developers” 1) Login as admin. 2) In “Administration” tag menu, select “User Management”  “Groups” and click on the “+ New Group” link. Then “Add new group” dialog screen comes up. 3) Set “developers” in “Group Name” field, and click “Save” button on “Add new group” dialog screen.
  123. Exercise of JFrog Artifactory OSS™ Configuration (5) • Create a

    Group named “developers” for “developer” User (2) 128 Installation of JFrog Artifactory OSS™ 2) In “Administration” tag menu, select “User Management”  “Groups” and click on the “+ New Group” link. Then “Add new group” dialog screen comes up.
  124. Exercise of JFrog Artifactory OSS™ Configuration (5) • Create a

    Group named “developers” for “developer” User (3) 129 Installation of JFrog Artifactory OSS™ 3) Set “developers” in “Group Name” field, and click “Save” button on “Add new group” dialog screen. 4) Confirm on “Groups” pane screen that a group named “developers” is successfully created.
  125. Exercise of JFrog Artifactory OSS™ Configuration (6) • The 8th

    step: Make a User called “developer” Create a User named “developer” who belongs to “developers” and “readers” Groups. 130 Installation of JFrog Artifactory OSS™ Rocky Linux™ 9.1 (Host Name: hostA) JFrog Artifactory OSS™ Derby™ Database Linux OS (Rocky Linux™) Tomcat™ Web App Server Users admin (1) developer (8) Groups readers developers (7) Permissions Any Remote (10) Any Local (9) central (2) (Remote Repo.) local-releases (3) (Local Repo.) local-snapshots (4) (Local Repo.) releases (5) (Virtual Repo.) snapshots (6) (Virtual Repo.) Accounts Repos Exercise: Let’s create a User named “developer”.
  126. Exercise of JFrog Artifactory OSS™ Configuration (6) • Create a

    User named “developer” (1) Procedure to make a User named “developer” who belongs to “developers” and “readers” Groups. 131 Installation of JFrog Artifactory OSS™ 8. Create a User called “developer” who belongs to “developers” and “readers” Groups 1) Login as admin. 2) In “Administration” tag menu, select “User Management”  “Users” and click on the “+ New User” link and then “Add new user” screen comes up. 3) Set “developer” in “User Name” field, an appropriate Email Address in “Email Address” field, an appropriate password in “Password” field, add “developers” in “Related Groups” field, and click “Save” button on “Add new user” dialog screen.
  127. Exercise of JFrog Artifactory OSS™ Configuration (6) • Create a

    User named “developer” (2) 132 Installation of JFrog Artifactory OSS™ 2) In “Administration” tag menu, select “User Management”  “Users” and click on the “+ New User” link and then “Add new user” screen comes up.
  128. Exercise of JFrog Artifactory OSS™ Configuration (6) • Create a

    User named “developer” (3) 133 Installation of JFrog Artifactory OSS™ 3) Set “developer” in “User Name” field, an appropriate Email Address in “Email Address” field, an appropriate password in “Password” field, add “developers” in “Related Groups” field, and click “Save” button on “Add new user” dialog screen. “developer”   Add “developers” . . . . . .
  129. Exercise of JFrog Artifactory OSS™ Configuration (6) • Create a

    User named “developer” (4) 134 Installation of JFrog Artifactory OSS™ 4) Confirm on “Users” pane screen that 1 user named “developer” is successfully created.
  130. Exercise of JFrog Artifactory OSS™ Configuration (7) • The 9th

    steps: Make a Permission called “Any Local” Create a Permission named “Any Local” which the “developers” Group has. 135 Installation of JFrog Artifactory OSS™ Rocky Linux™ 9.1 (Host Name: hostA) JFrog Artifactory OSS™ Derby™ Database Linux OS (Rocky Linux™) Tomcat™ Web App Server Users admin (1) developer (8) Groups readers developers (7) Permissions Any Remote (10) Any Local (9) central (2) (Remote Repo.) local-releases (3) (Local Repo.) local-snapshots (4) (Local Repo.) releases (5) (Virtual Repo.) snapshots (6) (Virtual Repo.) Accounts Repos Exercise: Let’s create a Permission named “Any Local”.
  131. Exercise of JFrog Artifactory OSS™ Configuration (7) • Create a

    Permission named “Any Local” (1) Procedure to make a Permission named “Any Local” which the “developers” Group has. 136 Installation of JFrog Artifactory OSS™ 9. Create a Permission and assign it to “developers” Group 1) Login as admin. 2) Go to “Identity & Access”  “Permissions” and click on the “New Permission” link. And then “Create Permission” dialog screen comes up. 3) Set “Any Local” as “Name” and click “Resources” tag and “Add Repositories” link on “Create Permission” dialog screen, and then “ADD REPOSITORY” dialog screen appears. 4) Set “developer” in “User Name” field and select “local-releases”, “local-snapshots” as “Included Repositories” and click “OK” button on “Add Repositories” dialog screen. 5) Click “Groups” tag and then “+ (Add Groups)” button shown as “+” on “Create Permission” dialog screen. And then “Select Groups” dialog screen comes up. 6) Select “developers” as “Included Groups” and click “OK” button. 7) Select “Read”, “Annotate”, “Deploy/Cache” and “Delete/Overwrite” for “Repositories” and click “Create” button.
  132. Exercise of JFrog Artifactory OSS™ Configuration (7) • Create a

    Permission named “Any Local”(2) 137 Installation of JFrog Artifactory OSS™ 2) In “Administration”, select “User Management”  “Permissions” and click on the “+ New Permission” link Then “Create Permission” dialog screen comes up.
  133. Exercise of JFrog Artifactory OSS™ Configuration (7) • Create a

    Permission named “Any Local”(3) 138 Installation of JFrog Artifactory OSS™ 3) Set “Any Local” in “Name” field and click “Resources” tab and “Add Repositories” link on “Create Permission” dialog screen and then “ADD REPOSITORY” dialog screen appears.
  134. Exercise of JFrog Artifactory OSS™ Configuration (7) • Create a

    Permission named “Any Local”(4) 139 Installation of JFrog Artifactory OSS™ 4) Set “developer” in “User Name” field and select “local-releases”, “local-snapshots” as “Included Repositories” and click “OK” button on “Add Repositories” dialog screen.
  135. Exercise of JFrog Artifactory OSS™ Configuration (7) • Create a

    Permission named “Any Local”(5) 140 Installation of JFrog Artifactory OSS™ 5) Click “Groups” tag and then “+ (Add Groups)” button shown as “+” on “Create Permission” dialog screen. And then “Select Groups” dialog screen comes up.
  136. Exercise of JFrog Artifactory OSS™ Configuration (7) • Create a

    Permission named “Any Local”(6) 141 Installation of JFrog Artifactory OSS™ 6) Select “developers” as “Included Groups” and click “OK” button on “Select Groups” dialog screen.
  137. Exercise of JFrog Artifactory OSS™ Configuration (7) • Create a

    Permission named “Any Local”(7) 142 Installation of JFrog Artifactory OSS™ 7) Select “Read”, “Annotate”, “Deploy/Cache” and “Delete/Overwrite” for “Repositories” and click “Create” button on “Create Permission” dialog screen.
  138. Exercise of JFrog Artifactory OSS™ Configuration (7) • Create a

    Permission named “Any Local”(8) 143 Installation of JFrog Artifactory OSS™ 8) Confirm on “Permissions” pane screen that 1 permission named “Any Local” is successfully created.
  139. Exercise of JFrog Artifactory OSS™ Configuration (8) • The 10th

    steps: Modify a Permission called “Any Remote” Modify a Permission named “Any Remote” to include the “developers” Group. 144 Installation of JFrog Artifactory OSS™ Rocky Linux™ 9.1 (Host Name: hostA) JFrog Artifactory OSS™ Derby™ Database Linux OS (Rocky Linux™) Tomcat™ Web App Server Users admin (1) developer (8) Groups readers developers (7) Permissions Any Remote (10) Any Local (9) central (2) (Remote Repo.) local-releases (3) (Local Repo.) local-snapshots (4) (Local Repo.) releases (5) (Virtual Repo.) snapshots (6) (Virtual Repo.) Accounts Repos Exercise: Let’s modify a Permission named “Any Remote” to include “developers” Group.
  140. Exercise of JFrog Artifactory OSS™ Configuration (8) • Modify a

    Permission named “Any Remote” (1) Procedure to modify a Permission named “Any Remote” to include the “developers” Group. 145 Installation of JFrog Artifactory OSS™ 10. Modify a Permission to include “developers” Group 1) Login as admin 2) In “Administration” tag menu, select “Identity & Access”  “Permissions” and click on the “Any Remote” link from “Permissions” list. Then “Edit Permission Any Remote” dialog screen comes up. 3) Click “Groups” tag and then “+ (Add Groups)” button on “Edit Permission Any Remote” dialog screen. And then “Select Groups” dialog screen comes up. 4) Select “developers” as “Included Groups” and click “OK” button on “Select Groups” dialog screen. 5) Select “Read” and “Deploy/Cache” for “Repositories” and click “Save” button
  141. Exercise of JFrog Artifactory OSS™ Configuration (7) • Modify a

    Permission named “Any Remote”(2) 146 Installation of JFrog Artifactory OSS™ 2) In “Administration” tag menu, select “Identity & Access”  “Permissions” and click on the “Any Remote” link from “Permissions” list. Then “Edit Permission Any Remote” dialog screen comes up.
  142. Exercise of JFrog Artifactory OSS™ Configuration (7) • Modify a

    Permission named “Any Remote”(3) 147 Installation of JFrog Artifactory OSS™ 3) Click “Groups” tag and then “+ (Add Groups)” button on “Edit Permission Any Remote” dialog screen. And then “Select Groups” dialog screen comes up.
  143. Exercise of JFrog Artifactory OSS™ Configuration (7) • Modify a

    Permission named “Any Remote”(4) 148 Installation of JFrog Artifactory OSS™ 4) Select “developers” as “Included Groups” and click “OK” button on “Select Groups” dialog screen.
  144. Exercise of JFrog Artifactory OSS™ Configuration (7) • Modify a

    Permission named “Any Remote”(5) 149 Installation of JFrog Artifactory OSS™ 5) Select “Read”, “Annotate” and “Deploy/Cache” for “Repositories” and click “Save” button on “Edit Permission Any Remote” dialog screen.
  145. Exercise of JFrog Artifactory OSS™ Configuration (7) • Modify a

    Permission named “Any Remote”(6) 150 Installation of JFrog Artifactory OSS™ 6) Confirm on “Permissions” pane screen that 1 permission named “Any Remote” is successfully modified.
  146. Exercise for deploying artifact to Aartifactory OSS™ PC JFrog Artifactory

    OSS™ “local-releases” Internal RELEASES Repository Server (Host Name: hostA) (Port: 8082) • The way to deploy a developed module to JFrog Artifactory OSS™ with M2Eclipse™ Deployed Module (Target Artifact): org.example.simple-0.0.1.jar org.example.simple-0.0.1.jar Configure Deployment Eclipse IDE for Enterprise Java Developer™ Local Repository M2Eclipse™ $HOME/.m2/settings.xml $PROJECT/pom.xml Project: org.example.simple 151 Exercise: Let’s deploy the target artifact to JFrog Artifactory OSS™ based on the above information.
  147. Exercise for deploying artifact to Aartifactory OSS™ • Configure JFrog

    Artifactory OSS™ account in $HOME/.m2/settings.xml <?xml version="1.0"?> <settings> <servers> <server> <id>repository-releases</id> <username>developer</username> <password>xxxxxxxx</password> </server> <server> <id>repository-snapshots</id> <username>developer</username> <password>xxxxxxxx</password> </server> </servers> : $HOME/.m2/settings.xml Specify username and password of “developer” User of Artifactory OSS™ for RELEASES repository Specify username and password of “developer” User of Artifactory OSS™ for SNAPSHOTS repository Configure Deployment 152
  148. Exercise for deploying artifact to Aartifactory OSS™ • Deploy org.example.simple-0.0.1.jar

    to the “local-releases” Internal RELEASES Repository of Artifactory OSS™ Server <project …> <modelVersion>4.0.0</modelVersion> <groupId>org.example</groupId> <artifactId>simple</artifactId> <version>0.0.1</version> <packaging>jar</packaging> : Deploy to the “local-releases” Internal RELEASES Repository of Artifactory OSS™ Server simple/pom.xml Configure Deployment 153
  149. Exercise for deploying artifact to Aartifactory OSS™ • Configure pom.xml

    for deploying a developed module to Artifactory OSS™ Server : <distributionManagement> <repository> <id>repository-releases</id> <name>Internal RELEASES Repository</name> <url>http://hostA:8082/artifactory/local-releases/</url> </repository> <snapshotRepository> <id>repository-snapshots</id> <name>Internal SNAPSHOTS Repository</name> <url>http://hostA:8082/artifactory/local-snapshots/</url> </snapshotRepository > </distributionManagement> </project> simple/pom.xml (Continued…) Specify URL for “local-releases” Internal RELEASES Repository of Artifactory OSS™ Specify URL for “local-snapshots” Internal SNALSHOTS Repository of Artifactory OSS ™ Configure Deployment 154
  150. Exercise for deploying artifact to Aartifactory OSS™ • With M2Eclipse,

    Execute deploy (1) Configure Deployment Right click on the “simple” project and select “Run As”  “4 Maven build…”. And then “Edit Configuration” dialog screen comes up. 155
  151. Exercise for deploying artifact to Aartifactory OSS™ • With M2Eclipse,

    Execute deploy (2) Configure Deployment Enter “Deploy simple” in “Name” field and “deploy” in “Goal” field and click “Run” button on “Edit configuration and launch” pane screen. 156
  152. Exercise for deploying artifact to Aartifactory OSS™ • With Artifactory

    Console, check the deployed project Configure Deployment After login to JFrog Artifactory OSS™, in “Application” tab menu, select “Artifactory”  “Artifacts” and select “local-releases” from the artifacts menu and traverse “org->example->simple->0.0.1”. 157
  153. Exercise for retrieving artifact from Aartifactory OSS™ Eclipse IDE for

    Enterprise Java Developer™ PC Local Repository Server (Host Name: hostA) (Port: 8082) M2Eclipse™ $HOME/.m2/settings.xml $PROJECT/pom.xml • The way to retrieve a dependent module from JFrog Artifactory OSS™ with M2Eclipse™ Dependent Module (Target Artifact): org.example.simple-0.0.1.jar org.example.simple-0.0.1.jar Configure Fetch Project: org.example.simple2 158 Exercise: Let’s fetch the target artifact from JFrog Artifactory OSS™ based on the above information. JFrog Artifactory OSS™ “releases” Cached Internal RELEASES Repository
  154. • Make a simple Maven project with M2Eclipse™ (1) In

    Project Explore, right click and select “New”  “Other…”. And then “New” dialog screen comes up. Exercise for retrieving artifact from Aartifactory OSS™ Configure Fetch 159
  155. • Make a simple Maven project with M2Eclipse™ (2) On

    “Select a wizard” pane screen, select “Maven”  “Maven Project” and click “Next >” button. Exercise for retrieving artifact from Aartifactory OSS™ Configure Fetch 160
  156. • Make a simple Maven project with M2Eclipse™ (3) On

    “New Maven project” pane screen, confirm that “Use default Workspace location” is selected. After then, click “Next >” button. Exercise for retrieving artifact from Aartifactory OSS™ Configure Fetch 161
  157. • Make a simple Maven project with M2Eclipse™ (4) On

    “New Maven project” pane screen, under “Select an Archetype”, select “Remote Catalog” or “All Catalogs” in “Catalog” field and “org.apache.maven.archetypes maven-archetype-simple 1.4” and click “Next >” button. Exercise for retrieving artifact from Aartifactory OSS™ Configure Fetch 162
  158. • Make a simple Maven project with M2Eclipse™ (4) On

    “New Maven project” pane screen, enter “org.example” in “Group Id” field and “simple2” in “Artifact Id” field and “0.0.1” in “Version” field and click “Finish” button. And enter “Y” in the console menu. Exercise for retrieving artifact from Aartifactory OSS™ Configure Fetch 163
  159. • Make a simple Maven project with M2Eclipse™ (5) Confirm

    that the following Maven project “simple2” was created successfully and change compiler version to “17”. Exercise for retrieving artifact from Aartifactory OSS™ Configure Fetch 164 11
  160. • Make a simple Maven project with M2Eclipse™ (6) Edit

    “App.java” to use a function of “simple” project deployed to JFrog Artifactory OSS™ ”local-releases” Internal RELEASES Repository. Exercise for retrieving artifact from Aartifactory OSS™ Add to show the message of project “simple” Configure Fetch 165
  161. Exercise for retrieving artifact from Aartifactory OSS™ • Configure JFrog

    Artifactory OSS™ account in $HOME/.m2/settings.xml (1) <?xml version="1.0"?> <settings> <servers> <server> <id>repository-releases</id> <username>developer</username> <password>xxxxxxxx</password> </server> <server> <id>repository-snapshots</id> <username>developer</username> <password>xxxxxxxx</password> </server> </servers> : $HOME/.m2/settings.xml Configure Fetch Specify username and password of Artifactory OSS™ account for RELEASES repository Specify username and password of Artifactory OSS™ account for SNAPSHOTS repository 166
  162. Exercise for retrieving artifact from Aartifactory OSS™ • Configure settings.xml

    for how to retrieve modules from JFrog Artifactory OSS™ (1) <profiles> <profile> <id>Repository Proxy</id> <activation> <activeByDefault>true</activeByDefault> </activation> <repositories> <repository> <id>repository-releases</id> : <url>http://hostA:8082/artifactory/releases/</url> : </repository> Specify URL for Cached Internal RELEASES repository of Artifactory OSS™ $HOME/.m2/settings.xml (<repositories> part) Configure $HOME/.m2/settings.xml Configure Fetch 167
  163. Exercise for retrieving artifact from Aartifactory OSS™ • Configure settings.xml

    for how to retrieve modules from JFrog Artifactory OSS™ (2) $HOME/.m2/settings.xml (<repositories> part) Configure $HOME/.m2/settings.xml <repository> <id>repository-snapshots</id> : <url>http://hostA:8082/artifactory/snapshots/</url> : </repository> </repositories> <pluginRepositories> <pluginRepository> <id>repository-releases</id> <name>Artifactory Managed Cached Internal RELEASES Repository</name> <url>http://hostA:8082/artifactory/releases/</url> </pluginRepository> </pluginRepositories> </profile> <profiles> Specify URL for Cached Internal RELEASES repository of Artifactory OSS™ Configure Fetch 168 Specify URL for Cached Internal SNAPSHOTS repository of Artifactory OSS™
  164. Exercise for retrieving artifact from Aartifactory OSS™ • Modify pom.xml

    to retrieve org.example.simple-0.0.1.jar from the RELEASES repository of JFrog Artifactory OSS™ Server <project …> : <dependencies> : <dependency> <groupId>org.example</groupId> <artifactId>simple</artifactId> <version>0.0.1</version> <type>jar</type> <scope>compile</scope> </dependency> : </dependencies> : </project> Retrieve the dependent module from Cached Internal RELEASES Repository of Artifactory OSS™ Server simple2/pom.xml Configure $HOME/.m2/settings.xml Configure Fetch 169 Add 1 dependency
  165. Exercise for retrieving artifact from Aartifactory OSS™ • Remove “org.example.simple”

    folder from the Local Repository With Explore, delete “<User Home>/.m2/repository/org/example/simple” folder to confirm that this project files will be retrieved from JFrog Artifactory OSS™ Server automatically later. Configure Fetch 170
  166. Exercise for retrieving artifact from Aartifactory OSS™ • With M2Eclipse,

    Execute build a package (1) Right click on the “simple2” project and select “Run As”  “4 Maven build…”. And then “Edit Configuration” dialog screen comes up. Configure Fetch 171
  167. Exercise for retrieving artifact from Aartifactory OSS™ • With M2Eclipse,

    Execute build a package (2) Enter “Package simple2” in “Name” field and “clean package” in “Goal” field and click “Run” button on “Edit configuration and launch” pane screen. Configure Fetch 172
  168. Exercise for retrieving artifact from Aartifactory OSS™ • Confirm that

    the folder of “org.example.simple” is created again in the local repository With Explore, check “<User Home>/.m2/repository/org/example/simple” folder which holds the project files retrieved from JFrog Artifactory OSS™ Server automatically. Configure Fetch 173
  169. Exercise for retrieving artifact from Aartifactory OSS™ • With M2Eclipse,

    Execute the project (1) Right click on the “simple2” project and select “Run As”  “1 Java Application”. And then “Select Java Application” dialog screen comes up. Configure Fetch 174
  170. Exercise for retrieving artifact from Aartifactory OSS™ • With M2Eclipse,

    Execute the project (2) Select on the “App – org.example.simple2” and click “OK” on “Select Java Application” dialog screen, and then confirm the message in “simple” project is shown on “Console” pane screen. Configure Fetch The message from the “simple” project is shown. 175
  171. Project org.ews.training.buildtool.exercise1 Exercise1 PC Server (Host Name: hostA) (Port: 8082)

    • The exercise to create a project and deploy the artifact to JFrog Artifactory OSS™ with M2Eclipse™ Target Artifact: org.ews.training.buildtool.exercise1-1.1.jar org.ews.training.buildtool.exercise1-1.1.jar Eclipse IDE for Enterprise Java Developer™ Local Repository M2Eclipse™ $HOME/.m2/settings.xml $PROJECT/pom.xml 177 JFrog Artifactory OSS™ “local-releases” Internal RELEASES Repository
  172. Project org.ews.training.buildtool.exercise2 Exercise2 Eclipse IDE for Enterprise Java Developer™ PC

    Local Repository Server (Host Name: hostA) (Port: 8082) M2Eclipse™ $HOME/.m2/settings.xml $PROJECT/pom.xml • The exercise to create a project and retrieve the artifact deployed in the previous exercise1 from JFrog Artifactory OSS™ with M2Eclipse™ Target artifact: org.ews.training.buildtool.exercise2-1.5.jar org.ews.training.buildtool.exercise1-1.1.jar 178 JFrog Artifactory OSS™ “releases” Cached Internal RELEASES Repository