Warning
This page is located in archive.

Introductory lesson - BOZP, JBoss AS, Maven, IDE, GIT

HTTP Protocol

See the introduction to the HTTP: HTTP intro

Glassfish 4.1

J2EE 7 certified server (reference implementation)

Description: https://glassfish.java.net/

Download, installation and start: Glassfish Installation

In case Glassfish is not working for you, use Payara or WildFly.

Run the server

Check the guide: Glassfish Guide

glassfish4/bin/asadmin start-domain

Management Console: http://localhost:4848

Maven

Software Project Management: http://maven.apache.org/

  • manages dependencies
  • compilation
  • packaging (jar, war, ear)
  • tests
  • maven plugins: code coverage, WAR deployment

Maven lifecycle: Maven Lifecycle

POM - project object model = project definition file (root file pom.xml).

Project structure:

src/
   main/
       java/
       resources/
       webapp/
   test/
       java/
       resources/
pom.xml

Dependencies

Maven uses the repository of libraries. The libraries can be searched: http://mvnrepository.com/artifact/org.apache.commons/commons-lang3/3.1

There are many Maven repositories worldwide, you can create your own

<dependency>
	<groupId>org.apache.commons</groupId>
	<artifactId>commons-lang3</artifactId>
	<version>3.1</version>
</dependency>

Maven dependencies can define the scope of the project:

Maven Installation

$ sudo apt-get install maven

Test example project

Download, unpack and test: test.zip

Repair the bug.

$ mvn test

JAVA EE 7 Samples

GIT - GITLAB

There is an GITLAB account for students: https://gitlab.fel.cvut.cz

Students may create repositories at GITLAB

Homework for next week

  1. Prepare teams of two
  2. Create a repo at GITLAB
  3. Study how Maven works. There will be no more time to study Maven
courses/a4m36aos/cviceni/class_1_10_2015.txt · Last modified: 2015/10/01 08:52 by kopriste