Extract version number from pom.xml to reduce duplication of the version number

This commit is contained in:
Yannik Hampe
2017-05-29 18:28:08 +02:00
parent b52d5b9e29
commit 0b86dcd8fe
4 changed files with 20 additions and 5 deletions

View File

@@ -0,0 +1,5 @@
package org.mustangproject.ZUGFeRD;
public final class Version {
public static final String VERSION = "${project.version}";
}

View File

@@ -237,7 +237,6 @@ public class ZUGFeRDExporter implements Closeable {
// // MAIN CLASS
private PDFAConformanceLevel conformanceLevel = PDFAConformanceLevel.UNICODE;
private String versionStr = "1.4.1";
// BASIC, COMFORT etc - may be set from outside.
private ZUGFeRDConformanceLevel zUGFeRDConformanceLevel = ZUGFeRDConformanceLevel.EXTENDED;
@@ -466,7 +465,7 @@ public class ZUGFeRDExporter implements Closeable {
String creator, boolean attachZugferdHeaders) throws IOException,
TransformerException {
String fullProducer = producer + " (via mustangproject.org "
+ versionStr + ")";
+ Version.VERSION + ")";
PDDocumentCatalog cat = doc.getDocumentCatalog();
PDMetadata metadata = new PDMetadata(doc);

View File

@@ -29,8 +29,6 @@ import java.io.InputStream;
import java.util.GregorianCalendar;
public class ZUGFeRDExporterFromA1Factory {
private static final String VERSION_STR = "1.4.0";
private boolean ignoreA1Errors = false;
private ZUGFeRDConformanceLevel zugferdConformanceLevel = ZUGFeRDConformanceLevel.EXTENDED;
private PDFAConformanceLevel conformanceLevel = PDFAConformanceLevel.U;
@@ -89,7 +87,7 @@ public class ZUGFeRDExporterFromA1Factory {
}
private void makePDFA3compliant(PDDocument doc) throws IOException {
String fullProducer = producer + " (via mustangproject.org " + VERSION_STR + ")";
String fullProducer = producer + " (via mustangproject.org " + Version.VERSION + ")";
PDDocumentCatalog cat = doc.getDocumentCatalog();
PDMetadata metadata = new PDMetadata(doc);