SlideShare a Scribd company logo
ECLIPSE
CODE STYLE
When working on a large team, code style is no place
to be creative.
Golden Rule
ALWAYS USE THE GOD DAMN STYLE
Benefits

✓ Minimize the change set on commits and conflicts
✓ Ease the overall readability of the code base
✓ Format the code automatically via IDE save actions
SAVE ACTIONS
Save actions allow you to automate a set of tasks that
will
Golden Rule
ALWAYS ENABLE THE GOD DAMN SAVE ACTIONS
Benefits

✓ Code style is applied automatically
✓ Imports are organized according to the same set of rules
✓ Minimize the change set on commits and conflicts
BUILD AUTOMATICALLY
When handling big projects, the build automatically
feature can be an unpleasant experience.
Golden Rule
SAY NO TO BUILD AUTOMATICALLY
Benefits

✓ Eclipse will be more responsive
✓ Embedded servlet containers will not react to code changes
✓ Embrace the limitations of FenixFramework
ECLIPSE JEDI
If you want to maximize your productivity, you should
use less mouse and more keyboard.
Golden Rule
LEARN YOUR TOOL AND SOME DAMN SHORTCUTS
Benefits

✓ Increase your productivity
✓ Fix and solve your problems quicker
✓ Look smart and geek
ECLIPSE JEDI - SHORTCUTS
Some of the most commonly used shortcuts
Ctrl+Space

Auto-complete

Ctrl+Shift+F

Fix Formatting

Ctrl+Shift+R

Open Resource

Ctrl+Shift+T

Open Type

Ctrl+O

Quick Outline

Ctrl+L

Go to Line

Ctrl+T

Quick Hierarchy
GIT
WHAT IS GIT?
Distributed Version Control System (DVCS) that
provides local branching for free.
Golden Rule
SNAPSHOTS NOT DIFFERENCES
Benefits

✓ Each clone is a safety copy
✓ Local branching is free of headaches
✓ Lots of awesome features (stash, rebase, squash, etc...)
SVN VS GIT
Checkins over time
Version 1

SVN

Version 2

file A

Version 3

Δ1

Δ1
Δ1

Version 5

Δ2

file B
file C

Version 4

Δ2

Δ2
Δ3

Checkins over time
Version 1

GIT

Version 2

Version 3

Version 4

Version 5

A

A1

A1

A2

A2

B

B

B

B1

B2

C

C1

C2

C2

C3
GIT REPOSITORY
A GIT repository, among other artifacts, is essentially
composed by:

✓ A set of commits
✓ A set of references (pointers) to commits (aka heads)
head A

44d5c
efc3a

a4b4a

d56d4
head B
COMMIT
A commit comprehends:

✓ A set of files (blobs) that reflect the state of the project at
a particular time

✓ Reference to the parent commits (i.e. the set of states
from which the new state was originated from)

✓ A SHA1 name which grants the commit unicity and
checksum properties

efc3a

a4b4a
HEAD

✓ A reference to a particular commit with a more human
perceptive name

✓ A Git repository can have any number of heads
✓ At a given time, one of the heads is selected as the current
head, which is also a reference called HEAD
head A

44d5c
efc3a

a4b4a

d56d4
head B

HEAD
INITIALIZING THE REPOSITORY
Git repositories work using your filesystem
The repository is handled in the .git folder in the root
of your project

$ git init
STAGE ONE OR MORE FILES

working
directory

staging
area

git
repository

git checkout
git add
git reset HEAD
git commit

$ touch README.md
$ git add README.md
SAVING THE SNAPSHOT (COMMIT)

master

efc3a

HEAD

$ git commit -m “Added README”
ADDING MORE FILES TO THE PICTURE

master

efc3a

HEAD

$ git add *.java
MAKING ANOTHER COMMIT

efc3a
master

ac2ad

HEAD

$ git commit -m “Added Java files”
BRANCHING (1)

efc3a
master

ac2ad

HEAD

$ git branch feature/x

feature/x
BRANCHING (2)

efc3a
master

ac2ad

feature/x
HEAD

$ git checkout feature/x
QUICK BRANCHING (1)

efc3a
master
HEAD

ac2ad
QUICK BRANCHING (2)

efc3a
master

ac2ad

feature/x
HEAD

$ git checkout -b feature/x
MERGING (1)

efc3a
master

ac2ad
4ecd4

feature/x
HEAD

$ git commit -m “Fixed stuff”
MERGING (1)

efc3a
master

ac2ad

HEAD

4ecd4

$ git checkout master

feature/x
MERGING (2)

efc3a
master

ac2ad

HEAD

4ecd4

$ git merge feature/x

feature/x
MERGING (3)

efc3a
ac2ad
master
HEAD

Fast-Forward

4ecd4

feature/x
MERGING (4)

efc3a
ac2ad
master

4ecd4

f3d3e

feature/x
HEAD

Other situation
MERGING (5)

efc3a
ac2ad
master

4ecd4

HEAD

$ git checkout master

f3d3e

feature/x
MERGING (6)

efc3a
ac2ad
4ecd4
master

f3d3e

feature/x

4ecd4

HEAD

$ git merge feature/x

Ugly History
DELETING A BRANCH

efc3a
ac2ad
4ecd4
master

f3d3e

4ecd4

HEAD

$ git branch -d feature/x

Ugly History
REBASE (1)

efc3a
ac2ad
master

4ecd4

f3d3e

feature/x
HEAD
REBASE (2)

efc3a
ac2ad
f3d3e
master

4ecd4
2fd3e

feature/x
HEAD

$ git rebase -i master
MERGING (1)

efc3a
ac2ad
master

Clean History

4ecd4

HEAD

2fd3e
$ git checkout master

feature/x
MERGING (2)

efc3a
ac2ad
4ecd4
master

2fd3e

feature/x

HEAD

$ git merge feature/x

Fast-Forward
GITHUB
A service that hosts Git repositories online with extra features

Contribution Methodology

✓ Create forks from other repositories
✓ Push commits to your own fork
✓ Request pulls from your fork (e.g. pull-requests)
CLONE
The clone command creates a full copy of the
repository, i.e. all commits, tags and heads.
Clone your fork
$ git clone --origin fork git@gihub.com:davidmartinho/fenix
(the --origin fork is to name the remote fork instead of the default origin)

Add FenixEdu as a remote to fetch updates
$ git remote add origin https://github.com/FenixEdu/fenix.git

Pull from FenixEdu with rebase to keep history clean
$ git pull --rebase origin master
PULL REQUESTS
The pull request is not a git feature.
Github has this pull request feature to improve
contributions and allows developers to merge outside
contributions directly on github.
Golden Rule
ALWAYS MAKE PULL REQUEST ON FENIX
MAVEN
WHAT IS MAVEN?
Maven is much more than a project building tool. It
allows you to build and manage your project.
Golden Rule
DEPENDENCIES BINARIES HAVE NO PLACE IN VCS
Benefits

✓ Convention over Configuration
✓ Keeps the VCS repository out of binaries
✓ Format the code automatically via IDE save actions
MAVEN BUILDING BLOCKS
LIFECYCLES
Maven knowns how a project is cleaned and built.
A lifecycle is essentially a pre-defined list of phases
to ensure such clean and build processes.
PLUGINS
The phases by themselves are worthless.
We associate plugin goals (implemented by Mojos)
to one of the phases.
CLEAN LIFECYCLE

pre-clean

pre-clean

execute necessary tasks prior to
project clean

clean

clean

deletes all files generated during the
building process

post-clean
executes necessary tasks needed
after the building process

post-clean
DEFAULT LIFECYCLE

generate-sources
compile

24 phases
omitted the most uncommon

process-classes
prepare-package
package
install
deploy
generate-sources
ff
maven
plugin

compile
process-classes
prepare-package
package
install
deploy
HOW DOES IT WORK?
generate-sources
ff
maven
plugin

maven-compiler-plugin

compile
process-classes
prepare-package
package
install
deploy
HOW DOES IT WORK?
generate-sources
ff
maven
plugin

maven-compiler-plugin

compile
process-classes
prepare-package
package
install
deploy
HOW DOES IT WORK?
generate-sources
ff
maven
plugin

maven-compiler-plugin

compile
process-classes
prepare-package

maven-jar-plugin

package
install
deploy
POM (Project Object Model)

✓ Declarative XML file
✓ Identifies your project (groupId, artifactId, version, packaging)
✓ Declares the project dependencies and their scopes
✓ Declares which plugin goals should run on which phase
✓ Declare additional repositories for the dependencies
REPOSITORIES
MAVEN CENTRAL REPOSITORY
Contains most of the commonly known Java
libraries (e.g. log4j, hibernate, jodatime, etc...)
DSI NEXUS REPOSITORY
Contains our binaries (e.g. fenix-framework, tools,
bennu, workflow, organization, etc...)
PROXIED THIRD-PARTY REPOSITORIES
Nexus allows us to proxy and cache some other
third-party repositories. Good when they’re out-ofservice
INSTALL VS DEPLOY
$ mvn clean install

📁

~/.m2/repository

$ mvn clean deploy

☁

fenix-ashes.ist.utl.pt/nexus

More Related Content

PPTX
Lets git to it
PPTX
Svn vs mercurial vs github
PPTX
Introduction git
PPTX
01 - Git vs SVN
PDF
From SVN to Git
PDF
Mini git tutorial
PPTX
Git Presentation
PDF
Brief tutorial on Git
Lets git to it
Svn vs mercurial vs github
Introduction git
01 - Git vs SVN
From SVN to Git
Mini git tutorial
Git Presentation
Brief tutorial on Git

What's hot (20)

PPTX
Introduction to git administration
PPTX
Git theory
PPT
Git training
PPTX
An introduction to Git and GitFlow
PDF
Subversion to Git Migration
PDF
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
PDF
Introduction to git
PDF
Git Tutorial I
PDF
BLUG 2012 Version Control for Notes Developers
PDF
Introduction to Git and GitHub
PPTX
Git extension-training
PPTX
Git tutorial git branches 20131206-Bryan
PDF
Git tutorial
PDF
Gitlab ci e kubernetes, build test and deploy your projects like a pro
PDF
Continuous Deployment with Kubernetes, Docker and GitLab CI
PDF
Git for beginners
PPT
Git Introduction
PPTX
Git 101
PDF
Git Version Control System
PDF
Git basics
Introduction to git administration
Git theory
Git training
An introduction to Git and GitFlow
Subversion to Git Migration
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to git
Git Tutorial I
BLUG 2012 Version Control for Notes Developers
Introduction to Git and GitHub
Git extension-training
Git tutorial git branches 20131206-Bryan
Git tutorial
Gitlab ci e kubernetes, build test and deploy your projects like a pro
Continuous Deployment with Kubernetes, Docker and GitLab CI
Git for beginners
Git Introduction
Git 101
Git Version Control System
Git basics
Ad

Viewers also liked (13)

PPT
Git vs SVN
PPTX
Getting Started with Git: A Primer for SVN and TFS Users
PPTX
Why we ditched TFS and embraced Git, Github, TeamCity and Myget
PPTX
From svn to git
PDF
Git: A Getting Started Presentation
KEY
Introduction to Git
PPTX
Basic Git Intro
PDF
Git 입문자를 위한 가이드
PDF
Github 사용법
PDF
Git 기본개념과 사용법 그리고 어플리케이션
PDF
svn 능력자를 위한 git 개념 가이드
PDF
[오픈소스컨설팅]Subversion vs git - 참을 수 없는 간단함
PPTX
Taking your version control to a next level with TFS and Git
Git vs SVN
Getting Started with Git: A Primer for SVN and TFS Users
Why we ditched TFS and embraced Git, Github, TeamCity and Myget
From svn to git
Git: A Getting Started Presentation
Introduction to Git
Basic Git Intro
Git 입문자를 위한 가이드
Github 사용법
Git 기본개념과 사용법 그리고 어플리케이션
svn 능력자를 위한 git 개념 가이드
[오픈소스컨설팅]Subversion vs git - 참을 수 없는 간단함
Taking your version control to a next level with TFS and Git
Ad

Similar to Training: Day Two - Eclipse, Git, Maven (20)

PPT
Life of a Chromium Developer
PDF
That's (g)it! par Sébastien Dawans CETIC
PDF
Becoming a Git Master
PDF
Git introduction
PDF
CMake - Introduction and best practices
PDF
Git - Intro to the Basics of DVCS
PDF
Git - Intro to the Basics of DVCS
PPTX
Obevo Javasig.pptx
PDF
Real-World Docker: 10 Things We've Learned
PDF
Git Power Routines
PPT
Collaboration With Git and GitHub
PPTX
Deploying Microservices - Makefiles, K8S Config Templates, Git Submodules, He...
PDF
Gradle como alternativa a maven
PPT
Embracing Distributed Version Control
PPT
Git presentation
PPTX
Build optimization mechanisms in GitLab and Docker
PDF
Living with Files More Happily
PDF
Apache DeltaSpike the CDI toolbox
PDF
Apache DeltaSpike: The CDI Toolbox
PDF
Саша Белецкий "Continuous Delivery в продуктовой разработке"
Life of a Chromium Developer
That's (g)it! par Sébastien Dawans CETIC
Becoming a Git Master
Git introduction
CMake - Introduction and best practices
Git - Intro to the Basics of DVCS
Git - Intro to the Basics of DVCS
Obevo Javasig.pptx
Real-World Docker: 10 Things We've Learned
Git Power Routines
Collaboration With Git and GitHub
Deploying Microservices - Makefiles, K8S Config Templates, Git Submodules, He...
Gradle como alternativa a maven
Embracing Distributed Version Control
Git presentation
Build optimization mechanisms in GitLab and Docker
Living with Files More Happily
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike: The CDI Toolbox
Саша Белецкий "Continuous Delivery в продуктовой разработке"

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
cuic standard and advanced reporting.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPT
Teaching material agriculture food technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
DOCX
The AUB Centre for AI in Media Proposal.docx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation theory and applications.pdf
PDF
KodekX | Application Modernization Development
PPTX
Big Data Technologies - Introduction.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Cloud computing and distributed systems.
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Per capita expenditure prediction using model stacking based on satellite ima...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
cuic standard and advanced reporting.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Teaching material agriculture food technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
The AUB Centre for AI in Media Proposal.docx
“AI and Expert System Decision Support & Business Intelligence Systems”
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation theory and applications.pdf
KodekX | Application Modernization Development
Big Data Technologies - Introduction.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Cloud computing and distributed systems.
MIND Revenue Release Quarter 2 2025 Press Release
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx

Training: Day Two - Eclipse, Git, Maven