0% found this document useful (0 votes)
85 views22 pages

Java EE 8 Setup with Eclipse and Maven

This document provides instructions for configuring Eclipse with the necessary tools and libraries to create a basic Spring application using Maven. It describes how to install Eclipse IDE with the Java EE version, add Spring Framework and Maven to Eclipse through the marketplace plugin, and rebuild Maven indexes. It then explains how to create a new Maven project, add dependencies for Spring, generate a POM file, add a Person class and beans configuration file, and create an App class to run the application.

Uploaded by

Fatmir Kelmendi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views22 pages

Java EE 8 Setup with Eclipse and Maven

This document provides instructions for configuring Eclipse with the necessary tools and libraries to create a basic Spring application using Maven. It describes how to install Eclipse IDE with the Java EE version, add Spring Framework and Maven to Eclipse through the marketplace plugin, and rebuild Maven indexes. It then explains how to create a new Maven project, add dependencies for Spring, generate a POM file, add a Person class and beans configuration file, and create an App class to run the application.

Uploaded by

Fatmir Kelmendi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd

Basic setup and

first program
Basic configuration
• Throughout this course we will use Eclipse
IDE
• Eclipse version should be Enterprise
Edition (JEE)
• We will need to add Spring Framework
and Maven to the Eclipse
• Maven should be already included in
newer Eclipse versions
Basic configuration
• Easiest way to install additional libraries is
through Eclipse Marketplace
Basic configuration
• Maven Integration
Basic configuration
• Maven is a tool that can now be used for building and
managing any Java-based project.
• Maven attempts to deal with:
– Making the build process easy
– Providing a uniform build system
– Providing quality project information
– Providing guidelines for best practices development
– Allowing transparent migration to new features
Basic configuration
• Maven allows a project to build using its project object
model (POM) and a set of plugins that are shared by all
projects using Maven, providing a uniform build system.
• Maven provides plenty of useful project information that is
in part taken from your POM and in part generated from
your project’s sources. For example, Maven can provide:
– Change log document created directly from source control
– Cross referenced sources
– Mailing lists
– Dependency list
– Unit test reports including coverage
Basic configuration
• Maven aims to gather current principles for best
practices development, and make it easy to guide a
project in that direction.
• For example, specification, execution, and reporting of
unit tests are part of the normal build cycle using Maven.
Current unit testing best practices were used as
guidelines:
– Keeping your test source code in a separate, but parallel source
tree
– Using test case naming conventions to locate and execute tests
– Have test cases setup their environment and don’t rely on
customizing the build for test preparation.
Basic configuration
• After adding Maven Integration, or if it was already included in
Eclipse, it is usually needed to rebuild indexes for the first time
• On the top menu bar, open Window -> Show View -> Other
• In the Show View window, open Maven -> Maven Repositories
Basic configuration
• In the window that appears, right-click on Global
Repositories and select Go Into
• Right-click on "central (
[Link] and select
"Rebuild Index"
– Note that it will take a while to complete the download
• Once indexing is complete, Right-click on the project
-> Maven -> Add Dependency and start typing the name
of the project you want to import (such as "hibernate").
– The search results will auto-fill in the "Search Results" box below.
Basic configuration
• Spring also needs to be added to Eclipse
First project
• How to create first Spring project using Maven?
First project
First project
• Group Id – package name
• Artifact Id – program name
First project
• Maven project setup
First project
• Add dependencies
First project
• POM looks like this:
First project
• Create simple [Link] class
First project
• Add [Link] file
First project
• Open [Link], select beans and add new bean for Person class
First project
• You should add id to this bean and connect it to the class
Person
First project
First project
• Create simple [Link] class

You might also like