summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pom.xml255
-rw-r--r--src/main/java/at/gv/util/data/ElectronicIdentity.java11
2 files changed, 192 insertions, 74 deletions
diff --git a/pom.xml b/pom.xml
index 4e4d5e5..b1d928a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,38 +5,174 @@
<modelVersion>4.0.0</modelVersion>
<groupId>at.gv.util</groupId>
<artifactId>egovutils</artifactId>
- <version>2.0.9-snapshot</version>
+ <version>2.0.9-SNAPSHOT</version>
<name>zuseutil</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <cxf.version>3.3.2</cxf.version>
+ <java.version>1.8</java.version>
+
+ <cxf.version>3.3.3</cxf.version>
+ <org.slf4j.version>1.7.28</org.slf4j.version>
+
+ <org.apache.httpcomponents.httpclient.version>4.5.10</org.apache.httpcomponents.httpclient.version>
+ <commons-collections.version>3.2.2</commons-collections.version>
+ <commons-lang.version>2.6</commons-lang.version>
+ <commons-codec.version>1.13</commons-codec.version>
+ <commons-beanutils.version>1.9.4</commons-beanutils.version>
+ <commons-validator.version>1.6</commons-validator.version>
+
+ <javax.xml.bind.jaxb-api.version>2.3.0</javax.xml.bind.jaxb-api.version>
+ <xalan.version>2.7.1</xalan.version>
+ <xerces.xercesImpl.version>2.11.0</xerces.xercesImpl.version>
+
+ <javax.servlet-api.version>2.5</javax.servlet-api.version>
+
+ <surefire.version>2.22.0</surefire.version>
+ <iaik_ecc.version>2.19</iaik_ecc.version>
+
</properties>
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ <property>
+ <name>default</name>
+ </property>
+ </activation>
+ <repositories>
+ <repository>
+ <id>egiz-commons</id>
+ <url>https://apps.egiz.gv.at/maven/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>egiz-commons-snapshot</id>
+ <url>https://apps.egiz.gv.at/maven-snapshot/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ </profile>
+ <profile>
+ <id>jenkinsDeploy</id>
+ <distributionManagement>
+ <repository>
+ <id>egizMaven</id>
+ <url>sftp://apps.egiz.gv.at/maven</url>
+ </repository>
+ <snapshotRepository>
+ <id>egizMaven</id>
+ <url>sftp://apps.egiz.gv.at/maven-snapshot</url>
+ </snapshotRepository>
+ </distributionManagement>
+ <repositories>
+ <repository>
+ <id>egiz-commons</id>
+ <url>https://apps.egiz.gv.at/maven/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ </repositories>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.8.2</version>
+ <configuration>
+ <deployAtEnd>true</deployAtEnd>
+ </configuration>
+ <executions>
+ <execution>
+ <id>default-deploy</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>deploy</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
<build>
- <plugins>
-<!-- <plugin>
- <groupId>org.owasp</groupId>
- <artifactId>dependency-check-maven</artifactId>
- <version>1.2.5</version>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin> -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.7.0</version>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.1.0</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- enable co-existence of testng and junit -->
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${surefire.version}</version>
<configuration>
- <source>1.8</source>
- <target>1.8</target>
+ <threadCount>1</threadCount>
</configuration>
- </plugin>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.surefire</groupId>
+ <artifactId>surefire-junit47</artifactId>
+ <version>${surefire.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>versions-maven-plugin</artifactId>
+ <version>2.7</version>
+ </plugin>
+
</plugins>
+
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-ssh</artifactId>
+ <version>3.3.3</version>
+ </extension>
+ </extensions>
</build>
@@ -44,34 +180,18 @@
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
- <version>2.11.0</version>
+ <version>${xerces.xercesImpl.version}</version>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
- <version>2.7.1</version>
- </dependency>
-<!-- <dependency>
- <groupId>com.sun</groupId>
- <artifactId>webservices-tools</artifactId>
- <version>2.0.1</version>
- </dependency>
- <dependency>
- <groupId>com.sun</groupId>
- <artifactId>webservices-rt</artifactId>
- <version>2.0.1</version>
- </dependency> -->
-<!-- <dependency>
- <groupId>org.glassfish.metro</groupId>
- <artifactId>webservices-rt</artifactId>
- <version>2.3</version>
- </dependency> -->
-
+ <version>${xalan.version}</version>
+ </dependency>
<dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.3.0</version>
-</dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>${javax.xml.bind.jaxb-api.version}</version>
+ </dependency>
<!-- Apache CXF libs-->
<dependency>
@@ -95,68 +215,65 @@
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
- <version>1.6</version>
+ <version>${commons-validator.version}</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
- <version>1.9.3</version>
+ <version>${commons-beanutils.version}</version>
</dependency>
- <!-- dependency>
- <groupId>bouncycastle</groupId>
- <artifactId>bcprov-jdk16</artifactId>
- <version>140</version>
- </dependency-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- <version>1.7.25</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.7.25</version>
+ <version>${org.slf4j.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
- <version>2.5</version>
+ <version>${javax.servlet-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
- <version>1.12</version>
+ <version>${commons-codec.version}</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
- <version>2.6</version>
+ <version>${commons-lang.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
-<!-- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.1</version>
- </dependency> -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
- <version>4.5.9</version>
+ <version>${org.apache.httpcomponents.httpclient.version}</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
- <version>3.2.2</version>
+ <version>${commons-collections.version}</version>
</dependency>
<dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>iaik</groupId>
<artifactId>iaik_ecc</artifactId>
- <version>2.19</version>
+ <version>${iaik_ecc.version}</version>
<scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${org.slf4j.version}</version>
+ <scope>test</scope>
</dependency>
</dependencies>
diff --git a/src/main/java/at/gv/util/data/ElectronicIdentity.java b/src/main/java/at/gv/util/data/ElectronicIdentity.java
index ea5bd25..afbf652 100644
--- a/src/main/java/at/gv/util/data/ElectronicIdentity.java
+++ b/src/main/java/at/gv/util/data/ElectronicIdentity.java
@@ -40,7 +40,8 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.lang.time.DateUtils;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -72,7 +73,7 @@ public final class ElectronicIdentity implements Serializable, Empty, RoleContai
private static final long serialVersionUID = 1L;
- private Logger log = Logger.getLogger(this.getClass().getName());
+ private Logger log = LoggerFactory.getLogger(this.getClass().getName());
private static final String FIRSTNAME = "firstname";
private static final String LASTNAME = "lastname";
@@ -331,7 +332,7 @@ public final class ElectronicIdentity implements Serializable, Empty, RoleContai
public ElectronicIdentity(AssertionType assertion, boolean isMOAIDAssertion) throws EgovUtilException {
this();
// debug moa-id response
- log.trace("Debug response: " + System.getProperty("debug.moaid.log.path") != null);
+ log.trace("Debug response: {}", System.getProperty("debug.moaid.log.path") != null);
if (System.getProperty("debug.moaid.log.path") != null) {
try {
ObjectFactory of = new ObjectFactory();
@@ -344,7 +345,7 @@ public final class ElectronicIdentity implements Serializable, Empty, RoleContai
fos.flush();
fos.close();
} catch(Exception e) {
- log.debug(e);
+ log.debug(e.getMessage(), e);
}
}
if (isMOAIDAssertion) {
@@ -506,7 +507,7 @@ public final class ElectronicIdentity implements Serializable, Empty, RoleContai
properties.getProperty(DATEOFBIRTH), new String[] { "yyyy-MM-dd",
"dd.MM.yyyy", }));
} catch (ParseException e) {
- log.error(e);
+ log.error(e.getMessage(), e);
}
}
this.setTitle(properties.getProperty(TITLE));