Commit e7b2fbc4 authored by Karel Frajtak's avatar Karel Frajtak

Converting to a Maven project

parent 3ec2d7d5
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="eShop" default="default" basedir=".">
<description>Builds, tests, and runs the project eShop.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar: JAR building
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="eShop-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
This diff is collapsed.
build.xml.data.CRC32=bd44c016
build.xml.script.CRC32=5d2926f4
build.xml.stylesheet.CRC32=8064a381@1.80.1.48
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=bd44c016
nbproject/build-impl.xml.script.CRC32=2bf384ee
nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48
compile.on.save=true
user.properties.file=C:\\Users\\Karel\\AppData\\Roaming\\NetBeans\\8.2\\build.properties
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/C:/Users/Karel/Documents/NetBeansProjects/eShop/src/shop/ShoppingCart.java</file>
<file>file:/C:/Users/Karel/Documents/NetBeansProjects/eShop/test/LoyaltyPointsTest.java</file>
<file>file:/C:/Users/Karel/Documents/NetBeansProjects/eShop/src/shop/Customer.java</file>
<file>file:/C:/Users/Karel/Documents/NetBeansProjects/eShop/src/storage/ItemStock.java</file>
<file>file:/C:/Users/Karel/Documents/NetBeansProjects/eShop/src/main/Shop.java</file>
<file>file:/C:/Users/Karel/Documents/NetBeansProjects/eShop/src/shop/Item.java</file>
<file>file:/C:/Users/Karel/Documents/NetBeansProjects/eShop/src/shop/EShopController.java</file>
<file>file:/C:/Users/Karel/Documents/NetBeansProjects/eShop/src/shop/Order.java</file>
<file>file:/C:/Users/Karel/Documents/NetBeansProjects/eShop/src/shop/DiscountedItem.java</file>
<file>file:/C:/Users/Karel/Documents/NetBeansProjects/eShop/src/shop/StandardItem.java</file>
</group>
</open-files>
</project-private>
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processor.options=
annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
# Uncomment to specify the preferred debugger connection transport:
#debug.transport=dt_socket
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# Files in build.classes.dir which should be excluded from distribution jar
dist.archive.excludes=
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/eShop.jar
dist.javadoc.dir=${dist.dir}/javadoc
excludes=
includes=**
jar.compress=false
javac.classpath=
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.external.vm=true
javac.processorpath=\
${javac.classpath}
javac.source=1.8
javac.target=1.8
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${libs.junit_4.classpath}:\
${libs.hamcrest.classpath}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=main.Shop
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
platform.active=default_platform
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project.
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
# To set system properties for unit tests define test-sys-prop.name=value:
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
source.encoding=UTF-8
src.dir=src
test.src.dir=test
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>eShop</name>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
</configuration>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cz.cvut</groupId>
<artifactId>eShop</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
<type>jar</type>
</dependency>
</dependencies>
<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>
</project>
\ No newline at end of file
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package main;
/**
*
* @author Karel
*/
public class Shop {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
}
}
package archive; package cz.cvut.eshop.archive;
import shop.Item; import cz.cvut.eshop.shop.Item;
class ItemPurchaseArchiveEntry { class ItemPurchaseArchiveEntry {
private Item refItem; private final Item refItem;
private int soldCount; private int soldCount;
ItemPurchaseArchiveEntry(Item refItem) { ItemPurchaseArchiveEntry(Item refItem) {
......
package archive; package cz.cvut.eshop.archive;
import cz.cvut.eshop.shop.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import shop.*;
import storage.*;
/** /**
* Class for archive of the purchases * Class for archive of the purchases
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* and open the template in the editor. * and open the template in the editor.
*/ */
package shop; package cz.cvut.eshop.shop;
public class Customer { public class Customer {
private int loyaltyPoints; private int loyaltyPoints;
......
package shop; package cz.cvut.eshop.shop;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
......
package shop; package cz.cvut.eshop.shop;
import archive.PurchasesArchive; import cz.cvut.eshop.archive.PurchasesArchive;
import java.text.SimpleDateFormat; import cz.cvut.eshop.storage.NoItemInStorage;
import cz.cvut.eshop.storage.Storage;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import storage.*;
import archive.*;
public class EShopController { public class EShopController {
......
package shop; package cz.cvut.eshop.shop;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
......
package shop; package cz.cvut.eshop.shop;
import java.util.ArrayList; import java.util.ArrayList;
......
package storage; package cz.cvut.eshop.storage;
import shop.*;
import cz.cvut.eshop.shop.Item;
/** /**
* Auxiliary class for item storage * Auxiliary class for item storage
......
package storage; package cz.cvut.eshop.storage;
public class NoItemInStorage extends Exception{ public class NoItemInStorage extends Exception{
public NoItemInStorage() { public NoItemInStorage() {
......
package storage; package cz.cvut.eshop.storage;
import archive.PurchasesArchive; import cz.cvut.eshop.shop.Item;
import cz.cvut.eshop.shop.Order;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import shop.*;
public class Storage { public class Storage {
......
import cz.cvut.eshop.shop.Customer;
import cz.cvut.eshop.shop.DiscountedItem;
import cz.cvut.eshop.shop.Order;
import cz.cvut.eshop.shop.ShoppingCart;
import cz.cvut.eshop.shop.StandardItem;
import java.util.Date; import java.util.Date;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
import shop.Customer;
import shop.DiscountedItem;
import shop.Order;
import shop.ShoppingCart;
import shop.StandardItem;
public class LoyaltyPointsTest { public class LoyaltyPointsTest {
......
#Generated by Maven
#Thu Nov 30 09:23:01 CET 2017
version=1.0-SNAPSHOT
groupId=cz.cvut
artifactId=eShop
-------------------------------------------------------------------------------
Test set: LoyaltyPointsTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.099 sec
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="2" failures="0" name="LoyaltyPointsTest" time="0.105" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
<property name="sun.boot.library.path" value="C:\Program Files\Java\jdk1.8.0_152\jre\bin"/>
<property name="java.vm.version" value="25.152-b16"/>
<property name="user.country.format" value="CZ"/>
<property name="java.vm.vendor" value="Oracle Corporation"/>
<property name="java.vendor.url" value="http://java.oracle.com/"/>
<property name="path.separator" value=";"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
<property name="java.vm.name" value="Java HotSpot(TM) 64-Bit Server VM"/>
<property name="file.encoding.pkg" value="sun.io"/>
<property name="user.script" value=""/>
<property name="user.country" value="US"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="sun.os.patch.level" value=""/>
<property name="test" value="LoyaltyPointsTest"/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="user.dir" value="C:\Users\Karel\Documents\NetBeansProjects\eShop"/>
<property name="java.runtime.version" value="1.8.0_152-b16"/>
<property name="java.awt.graphicsenv" value="sun.awt.Win32GraphicsEnvironment"/>
<property name="java.endorsed.dirs" value="C:\Program Files\Java\jdk1.8.0_152\jre\lib\endorsed"/>
<property name="os.arch" value="amd64"/>
<property name="java.io.tmpdir" value="C:\Users\Karel\AppData\Local\Temp\"/>
<property name="line.separator" value="
"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="user.variant" value=""/>
<property name="os.name" value="Windows 10"/>
<property name="maven.ext.class.path" value="G:\Program Files\NetBeans 8.2\java\maven-nblib\netbeans-eventspy.jar"/>
<property name="classworlds.conf" value="G:\Program Files\NetBeans 8.2\java\maven\bin\m2.conf"/>
<property name="sun.jnu.encoding" value="Cp1250"/>
<property name="java.library.path" value="C:\Program Files\Java\jdk1.8.0_152\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Docker\Docker\Resources\bin;C:\Program Files\PHP\v7.0;C:\Program Files\Microsoft MPI\Bin\;C:\Program Files (x86)\PHP\v5.6;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Users\Karel\AppData\Roaming\npm;C:\Program Files\nodejs;C:\tools\python2;C:\tools\python2\app;C:\tools\python3;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Utils\Python2\App;C:\Utils\Python2;C:\Users\Karel\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\Windows Kits\10\Windows Performanc;C:\Program Files (x86)\Microsoft Team Foundation Server 2015 Power Tools\;C:\Program Files (x86)\Microsoft SQL Server\Client S;C:\Program Files (x86)\dotnet\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\nodejs\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\OpenVPN\bin;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\LyX 2.2\Perl\bin;C:\Program Files (x86)\Microsoft Team Foundation Server 2015 Power Tools\;C:\Utils\SeleniumDrivers;C:\Program Files\Git\cmd;C:\Program Files\Java\jdk1.8.0_152\bin;C:\Users\Karel\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc2-20221\bin;C:\Users\Karel\Anaconda3;C:\Users\Karel\Anaconda3\Scripts;C:\Users\Karel\Anaconda3\Library\bin;C:\Users\Karel\.dnx\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\HashiCorp\Vagrant\bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\nodejs\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\nodejs;C:\tools\python2;C:\tools\python2\app;C:\tools\python3;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Utils\Python2\App;C:\Utils\Python2;C:\Program Files\Microsoft DNX\D;C:\Users\Karel\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin;C:\Users\Karel\AppData\Roaming\npm;C:\Users\Karel\AppData\Local\Microsoft\WindowsApps;;C:\Program Files\Docker Toolbox;C:\Program Files\Microsoft VS Code\bin;C:\Users\Karel\AppData\Local\Programs\Fiddler;."/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="java.class.version" value="52.0"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.version" value="10.0"/>
<property name="user.home" value="C:\Users\Karel"/>
<property name="user.timezone" value="Europe/Prague"/>
<property name="java.awt.printerjob" value="sun.awt.windows.WPrinterJob"/>
<property name="java.specification.version" value="1.8"/>
<property name="file.encoding" value="UTF-8"/>
<property name="user.name" value="Karel"/>
<property name="java.class.path" value="G:\Program Files\NetBeans 8.2\java\maven\boot\plexus-classworlds-2.4.jar"/>
<property name="java.vm.specification.version" value="1.8"/>
<property name="sun.arch.data.model" value="64"/>
<property name="java.home" value="C:\Program Files\Java\jdk1.8.0_152\jre"/>
<property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher -Dtest=LoyaltyPointsTest -Dmaven.ext.class.path=G:\Program Files\NetBeans 8.2\java\maven-nblib\netbeans-eventspy.jar -Dfile.encoding=UTF-8 surefire:test"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="user.language" value="en"/>
<property name="user.language.format" value="cs"/>
<property name="awt.toolkit" value="sun.awt.windows.WToolkit"/>
<property name="java.vm.info" value="mixed mode"/>
<property name="java.version" value="1.8.0_152"/>
<property name="java.ext.dirs" value="C:\Program Files\Java\jdk1.8.0_152\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext"/>
<property name="sun.boot.class.path" value="C:\Program Files\Java\jdk1.8.0_152\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_152\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_152\jre\classes"/>
<property name="java.vendor" value="Oracle Corporation"/>
<property name="maven.home" value="G:\Program Files\NetBeans 8.2\java\maven"/>
<property name="file.separator" value="\"/>
<property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/"/>
<property name="sun.cpu.endian" value="little"/>
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
<property name="sun.desktop" value="windows"/>
<property name="sun.cpu.isalist" value="amd64"/>
</properties>
<testcase classname="LoyaltyPointsTest" name="willGetLoyaltyPoints" time="0.006"/>
<testcase classname="LoyaltyPointsTest" name="willGetDiscountForLoyaltyPoints" time="0"/>
</testsuite>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment