Session 2
-
Upload
gayathiry -
Category
Technology
-
view
546 -
download
0
description
Transcript of Session 2
![Page 1: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/1.jpg)
Yarl IT Hub Crash course SESSION 2 : Introduction to Source
control/Git hub and Maven
By : Gayathiry
![Page 2: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/2.jpg)
1. A very brief introduction to source control ◦ What is source control◦ Why we need it◦ How to manage (commands can be used/ things
needs to be considered before commit)
2.◦ “Hello Jaffna” Compile it and run using command line◦ Development tools and build tools◦ Create project structure with specified archtype◦ Simple maven targets◦ Build and run using maven
Road map
![Page 3: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/3.jpg)
3.◦ create account and repository on github◦ Install and setup github◦ fork and clone project◦ pull/push request
4.◦ Fork and clone yshool◦ Pull yschool to local repo◦ Clean and deploy using maven◦ Make some change push it back
Road map ctd…
![Page 4: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/4.jpg)
tracks and provides control over changes to source code
Examples :• Github• SVN(Subversion)• CVS• etc
What is source/revision/version control ?
![Page 5: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/5.jpg)
Why we need it ? track files Periodically commit history will help to collaborate with other
developers merge between other developers compare and revert with previous version of
project/individual files
![Page 6: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/6.jpg)
Getting and Creating Projects Basic Snapshotting Branching and Merging Sharing and Updating Projects Inspection and Comparison
Operations
![Page 7: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/7.jpg)
Make sure that you are working on the latest version of a file.
Check out only what you need. Check in promptly. Write good check-in comments.
Best Practices
![Page 8: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/8.jpg)
public class AppTest{
public static void main(String [] args){System.out.println("Hello Jaffna!");
}}
Compile using command line• Javac AppTest.java• Java AppTest
Sample
![Page 9: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/9.jpg)
Build process is repetitive process where programmer builds the project again and again to test the changes in the project code
Build tools automate the repetitive process and allows the programmer to concentrate on the project development
Building in a single click
What is build process & Why we need build tools ?
![Page 10: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/10.jpg)
Dependency management Versioning Compile Java code, build jars Execute tests and report results, fail build
on failed tests Run quality-check tools (PMD, Findbugs,
Checkstyles) File generation (XmlBeans, Xsl, Velocity,
AspectJ) Property expansion / token substitution
Desired features
![Page 11: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/11.jpg)
software project management and comprehension tool
Based on the concept of a project object model (POM),
Maven can manage a project's build, reporting and documentation from a central piece of information.
What is maven ?
![Page 12: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/12.jpg)
In Maven, an archetype is a template of a project which is combined with some user input to produce a working Maven project
mvn archetype:generate -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=package-name -DartifactId=project-name
Create your first project in maven
![Page 13: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/13.jpg)
Project – Top level modelVersion - what version of the object
model this POM groupId - unique identifier of the organization artifactId - unique base name of the primary
artifact/context packaging - package type version name - display name url - where the project's site can be found description - basic description of your project
POM ctd…
![Page 14: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/14.jpg)
Sample POM
![Page 15: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/15.jpg)
mvn compile mvn test mvn install mvn package mvn clean
http://maven.apache.org/guides/getting-started/index.html#How_do_I_compile_my_application_sources
MVN targets
![Page 16: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/16.jpg)
git is a distributed version control system Is a place where we store our publicly
available source code for client libraries.
Github source control
![Page 17: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/17.jpg)
Getting and Creating Projects• Init• clone
Basic Snapshotting• add• status• diff• commit• reset• rm, mv
Git reference
![Page 18: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/18.jpg)
Branching and Merging• branch• checkout• merge• log• tag
Sharing and Updating Projects• fetch, pull• push• remote
Inspection and Comparison• log• diff
Git reference ctd
![Page 19: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/19.jpg)
Set Up Git Add git plugin• Download :
https://github.com/rishabhsrao/peek-into-github/downloads
• Instruction : http://cloud.github.com/downloads/rishabhsrao/peek-into-github/README.txt
Create A Repository Fork A Repository
DEMO
![Page 20: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/20.jpg)
Created a maven project Setup git Push that to your account Fork and clone and existing project Send fetch & pull requests
Finally…
![Page 21: Session 2](https://reader035.fdocuments.us/reader035/viewer/2022062513/555c249ad8b42a0b418b4bd9/html5/thumbnails/21.jpg)
THANK YOU!