User Tools

Site Tools


zalozeni:prerequisities:pom

pom.xml

The pom.xml file is the core of a project's configuration in Maven. It is a single configuration file that contains the majority of information required to build a project in just the way you want.

Hlavicka

Hlavicka muze vypadat nasledovne. Jedine, co se bude v prubehu vytvareni projektu modifikovat, je <version>

	<groupId>cz.jlochman.marklar</groupId>
	<artifactId>plastometer</artifactId>
	<version>1.1.0</version>
	<packaging>jar</packaging>

Properties

Pod hlavickou by mely nasledovat <properties>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
	</properties>

Distribuce, Repozitare

Marklar (a nektere knihovny, ktere pouziva) je ulozen na Beryho serveru a ten je treba rovnez deklarovat

	<distributionManagement>
		<repository>
			<id>Berescak</id>
			<name>Berescak-releases</name>
			<url>http://berescak.cz:8081/artifactory/marklar-releases</url>
		</repository>
	</distributionManagement>
	<repositories>
		<repository>
			<id>Berescak</id>
			<name>Berescak-releases</name>
			<url>http://berescak.cz:8081/artifactory/marklar-releases</url>
		</repository>
	</repositories>

<distributionManagement> deklaruje, kam se projekt deployne, pokud je nad nim zavolano Run as → Maven build… a jako Goals: se vyplni deploy. <repositories> definuje dodatecny repozitar, odkud maven taha sve baliky

Dependencies

Marklar

Zavislost na Marklaru

	<dependency>
		<groupId>cz.jlochman</groupId>
		<artifactId>marklar-core</artifactId>
		<version>1.1.0</version>
	</dependency>
 
	<dependency>
		<groupId>cz.jlochman</groupId>
		<artifactId>marklar-fx-common</artifactId>
		<version>1.1.0</version>
	</dependency>
 
	<dependency>
		<groupId>cz.jlochman</groupId>
		<artifactId>marklar-driver-modbus</artifactId>
		<version>1.1.0</version>
	</dependency>

PID

PID regulace (je nahrano rovnez u Beryho)

	<dependency>
		<groupId>org.pid4j</groupId>
		<artifactId>pid</artifactId>
		<version>0.0.1-SNAPSHOT</version>
	</dependency>

Gauge

Paradicky v grafice (zobrazovani tachometru a podobne ptakoviny)

	<dependency>
		<groupId>eu.hansolo</groupId>
		<artifactId>Medusa</artifactId>
		<version>4.8</version>
	</dependency>

PDF Box

Vytvareni PDF

	<dependency>
		<groupId>org.apache.pdfbox</groupId>
		<artifactId>pdfbox</artifactId>
		<version>2.0.0</version>
	</dependency>

Build

Posledni casti pom.xml jsou informace pro buildeni jaru. Pro buildeni staci volat Run As → Maven Install. Jedine, co je treba modifikovat v nasledujicim snippetu je <mainClass>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.6</version>
				<configuration>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
					<finalName>marklar</finalName>
					<archive>
						<manifest>
							<mainClass>cz.jlochman.marklar.plastometer.PlastTestApp</mainClass>
						</manifest>
					</archive>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
zalozeni/prerequisities/pom.txt · Last modified: 2016/07/22 09:19 by jlochman