I am new to liquibase and have created a sample table utilizing a spring boot + liquibase project. My initial changelog to create the table in file 'createSampleTable.xml':
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.7"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.7
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.7.xsd">
<changeSet id="1" author="Russ">
<comment>A sample table to see if liquibase works</comment>
<createTable tableName="testy">
<column name="VALUE" type="varchar(32)"/>
</createTable>
<insert tableName="testy">
<column name="value" value="Hello, world!"/>
</insert>
<insert tableName="testy">
<column name="value" value="Riddikulus!"/>
</insert>
</changeSet>
</databaseChangeLog>
Now that I've verified my liquibase configuration, this same deployment has run in our 2 lower regions (dev and test) but we have not yet stood up stage or prod. I would like to "undo" the sample table and start creating my real database structure.
My understanding is I have two options: conditional drop table, rollback
I am currently trying to implement the conditional drop table as the documentation states but the proposed attributes are not recognized even though the preconditions documentation clearly states the onFail annotation should be recognized. Here is my implementation of the proposed solution (this is the current contents of the 'createSampleTable.xml' file:
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.7"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.7
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.7.xsd">
<!-- The documentation for liquibase says if you ever create a changeset
in error that you never really wanted to follow this approach.
The general idea is to delete the original changeset and then
provide a new changeset that should only run if the original changset
has run as well. In essence this allows us to remove a naughty change
entirely from the code and prevent it from being run in new
environments while providing an "undo" changeset to be ran in
environments where this changeset has unfortunately already ran.
Documentation referenced and approach taken:
http://www.liquibase.org/2008/10/dealing-with-changing-changesets.html
To satisfy developer's curiosity and prevent them from having to
look up the history in the repository the original changeset of id=1
was simply to create a sample table to make sure the initial liquibase
config was working.
-->
<changeSet id="1-undo" author="Russ">
<preConditions onFail="MARK_RAN">
<changeSetExecuted id="1" author="Russ" changeLogFile="liquibase/createSampleTable.xml" />
</preConditions>
<dropTable tableName="testy"/>
</changeSet>
</databaseChangeLog>
However, when running this both the onFail attribute and the
<changeSetExecuted> tag are unrecognized by the schema. After this I tried to implement the maven plugin to rollback, but this executes on the build, so this target will only ever resolve one region.
What is the generally accepted approach for undoing changes? Does the approach differ if you're implementing a spring boot liquibase project?
Looks like your applied schema is quite old (1.7).
Check your included version (if Maven, check your pom).
You should be able to use the required tags if you use the 3.1 version xml schema:
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
...
</databaseChangeLog>
Note the schema dbchangelog-3.1.xsd
If using Maven, the above schema works with the following plugin config:
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<propertyFile>src/main/liquibase.properties</propertyFile>
</configuration>
</plugin>
Related
I'm facing a problem using Liquibase with MySQL 8 where the following script is not putting the fraction part of type "time(3)", it only puts "time" on the type of the column. We run this script before with MySQL 5 and it worked fine.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.16.xsd"
logicalFilePath="20220901.xml">
<changeSet author="MyUser" id="Change column 'time' to Datatype to milliseconds">
<modifyDataType
columnName="time"
newDataType="TIME(3)"
schemaName="${defaultSchema}"
tableName="table1"/>
<addNotNullConstraint
columnDataType="TIME(3)"
columnName="time"
schemaName="${defaultSchema}"
tableName="table1" />
</changeSet>
</databaseChangeLog>
I tried to update to most recent versions on maven dependencies of liquibase.core(to 4.16.1) and mysql-connector-java(to 8.0.30), the problem persists.
After multiple tests, i discover that the problem may be on liquibase generated query that not includes the fraction part "(3)", so as a workaround I used "modifySql" to change the query at the end.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.16.xsd"
logicalFilePath="20220901.xml">
<!-- WORK-AROUND - Liquibase was generating a query with type 'TIME' instead of 'TIME(3)' so
we use 'REPLACE_WITH_TIME' as auxiliary type to replace all of it's occurrences in query
by 'TIME(3)' with 'modifySql'. -->
<changeSet author="MyUser"
id="Fix time column type to time(3) - 2022-10-06">
<modifyDataType columnName="time"
newDataType="REPLACE_WITH_TIME" schemaName="${defaultSchema}"
tableName="table1" />
<addNotNullConstraint columnDataType="REPLACE_WITH_TIME"
columnName="time" schemaName="${defaultSchema}"
tableName="table1" />
<modifySql>
<replace replace="REPLACE_WITH_TIME" with="TIME(3)" />
</modifySql>
</changeSet>
</databaseChangeLog>
It resolves the problem but its not the best solution.
So i wanted to ask if anybody noticed that and knows if its actally a liquibase bug or not.
Thanks in advance.
I am getting JdbcSQLIntegrityConstraintViolationException exception while starting my server.
Seems like some problem in using <map>, earlier it was working file with older version of H2 but now not working.
My curren H2 version is:
implementation group: 'com.h2database', name: 'h2', version: '1.4.200'
Older was:
compile group: 'com.h2database', name: 'h2', version: '1.4.193'
My class is using simple map variable like: private Map<String, String> extraData;
Can someone tell me, how to fix this???
Thanks
Here is my XML snippet:
<class name="pojo.MachineInstruction" >
<id name="machineId" type="java.lang.Integer"/>
<!--Time stamp is auto generated. No need to set the value..-->
<timestamp name="timestamp"/>
<property name="instructionType" not-null="true">
<type name="org.hibernate.type.EnumType">
<param name="enumClass">pojo.MachineInstructionType</param>
</type>
</property>
<property name="instructionStatus" not-null="true">
<type name="org.hibernate.type.EnumType">
<param name="enumClass">pojo.MachineInstructionStatus</param>
</type>
</property>
<property name="version" type="java.lang.String"/>
<map name="extraData" cascade="all">
<key column="extraData" />
<map-key type="text" column="key"/>
<element type="text" column="value"/>
</map>
</class>
Caused by: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Unique index or primary key violation: "PRIMARY KEY ON """".PAGE_INDEX"; SQL statement:
ALTER TABLE PUBLIC.MACHINEINSTRUCTION_EXTRADATA ADD CONSTRAINT PUBLIC.FKROHO504EJPG9G4R81YYKTV44K FOREIGN KEY(EXTRADATA) REFERENCES PUBLIC.MACHINEINSTRUCTION(MACHINEID) NOCHECK [23505-200]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:459)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:429)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.pagestore.db.PageDataIndex.add(PageDataIndex.java:125)
at org.h2.pagestore.PageStore.addMeta(PageStore.java:1804)
at org.h2.pagestore.db.PageBtreeIndex.<init>(PageBtreeIndex.java:65)
at org.h2.pagestore.db.PageStoreTable.addIndex(PageStoreTable.java:183)
at org.h2.command.ddl.AlterTableAddConstraint.createIndex(AlterTableAddConstraint.java:298)
at org.h2.command.ddl.AlterTableAddConstraint.tryUpdate(AlterTableAddConstraint.java:223)
at org.h2.command.ddl.AlterTableAddConstraint.update(AlterTableAddConstraint.java:78)
at org.h2.engine.MetaRecord.execute(MetaRecord.java:60)
at org.h2.engine.Database.open(Database.java:759)
at org.h2.engine.Database.openDatabase(Database.java:307)
at org.h2.engine.Database.<init>(Database.java:301)
at org.h2.engine.Engine.openSession(Engine.java:74)
at org.h2.engine.Engine.openSession(Engine.java:192)
at org.h2.engine.Engine.createSessionAndValidate(Engine.java:171)
at org.h2.engine.Engine.createSession(Engine.java:166)
at org.h2.engine.Engine.createSession(Engine.java:29)
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:340)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:173)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:152)
at org.h2.Driver.connect(Driver.java:69)
at org.hibernate.engine.jdbc.connections.internal.DriverConnectionCreator.makeConnection(DriverConnectionCreator.java:38)
... 35 more
Unfortunately, H2 1.4.* and older versions don't have automatic upgrade procedure, it is under responsibility of their users.
https://h2database.com/html/tutorial.html#upgrade_backup_restore
(The upcoming H2 2.0 will have a built-in upgrade utility and will refuse to open old files without upgrade to avoid such issues.)
1.4.196 and older versions had a bug with some combinations of indexes and referential constraints, it was fixed in 1.4.197, but upgrade path for the legacy PageStore engine wasn't provided. MVStore also had similar upgrade issues, but they were fixed.
Right now your database seems to be corrupted, because upgrade wasn't performed. You need to write some dummy implementation of org.h2.api.DatabaseEventListener, put it into the classpath of your application (classpath of your server if you use separate H2 Server process), and open your database with ;DATABASE_EVENT_LISTENER='path.to.YourListener' appended to JDBC connection URL. Wrong constraints will be logged to your listener. After that you will be able to export your database to the SQL Script with SCRIPT TO 'filename.sql' command and create a new database file and populate it with that script with RUNSCRIPT FROM 'filename.sql'.
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd
http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="Administrator" id="20" runOnChange="true">
<modifyColumn tableName="TEST_TABLE">
<column name="FIELD_NAME" type="java.sql.Types.VARCHAR(250)" />
</modifyColumn>
</changeSet>
</databaseChangeLog>
I'm new to liquibase, Can anybody help me on how to use liquibase-modify-column jar for using modifyColumn feature in liquibase 3.6.3 to fix the current problem.
cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://www.liquibase.org/xml/ns/dbchangelog":modifyColumn}'. One of '{"http://www.liquibase.org/xml/ns/dbchangelog":comment, "http://www.liquibase.org/xml/ns/dbchangelog":createTable, "http://www.liquibase.org/xml/ns/dbchangelog":dropTable, "http://www.liquibase.org/xml/ns/dbchangelog":createView, "http://www.liquibase.org/xml/ns/dbchangelog":renameView, "http://www.liquibase.org/xml/ns/dbchangelog":dropView, "http://www.liquibase.org/xml/ns/dbchangelog":insert, "http://www.liquibase.org/xml/ns/dbchangelog":addColumn, "http://www.liquibase.org/xml/ns/dbchangelog":sql, "http://www.liquibase.org/xml/ns/dbchangelog":createProcedure, "http://www.liquibase.org/xml/ns/dbchangelog":dropProcedure, "http://www.liquibase.org/xml/ns/dbchangelog":sqlFile, "http://www.liquibase.org/xml/ns/dbchangelog":renameTable, "http://www.liquibase.org/xml/ns/dbchangelog":renameColumn, "http://www.liquibase.org/xml/ns/dbchangelog":dropColumn, "http://www.liquibase.org/xml/ns/dbchangelog":mergeColumns, "http://www.liquibase.org/xml/ns/dbchangelog":modifyDataType, "http://www.liquibase.org/xml/ns/dbchangelog":createSequence, "http://www.liquibase.org/xml/ns/dbchangelog":alterSequence, "http://www.liquibase.org/xml/ns/dbchangelog":dropSequence, "http://www.liquibase.org/xml/ns/dbchangelog":createIndex, "http://www.liquibase.org/xml/ns/dbchangelog":dropIndex, "http://www.liquibase.org/xml/ns/dbchangelog":addNotNullConstraint, "http://www.liquibase.org/xml/ns/dbchangelog":dropNotNullConstraint, "http://www.liquibase.org/xml/ns/dbchangelog":addForeignKeyConstraint, "http://www.liquibase.org/xml/ns/dbchangelog":dropForeignKeyConstraint, "http://www.liquibase.org/xml/ns/dbchangelog":dropAllForeignKeyConstraints, "http://www.liquibase.org/xml/ns/dbchangelog":addPrimaryKey, "http://www.liquibase.org/xml/ns/dbchangelog":dropPrimaryKey, "http://www.liquibase.org/xml/ns/dbchangelog":addLookupTable, "http://www.liquibase.org/xml/ns/dbchangelog":addAutoIncrement, "http://www.liquibase.org/xml/ns/dbchangelog":addDefaultValue, "http://www.liquibase.org/xml/ns/dbchangelog":dropDefaultValue, "http://www.liquibase.org/xml/ns/dbchangelog":addUniqueConstraint, "http://www.liquibase.org/xml/ns/dbchangelog":dropUniqueConstraint, "http://www.liquibase.org/xml/ns/dbchangelog":customChange, "http://www.liquibase.org/xml/ns/dbchangelog":update, "http://www.liquibase.org/xml/ns/dbchangelog":delete, "http://www.liquibase.org/xml/ns/dbchangelog":loadData, "http://www.liquibase.org/xml/ns/dbchangelog":loadUpdateData, "http://www.liquibase.org/xml/ns/dbchangelog":executeCommand, "http://www.liquibase.org/xml/ns/dbchangelog":empty, "http://www.liquibase.org/xml/ns/dbchangelog":stop, "http://www.liquibase.org/xml/ns/dbchangelog":rollback, WC[##other:"http://www.liquibase.org/xml/ns/dbchangelog"], "http://www.liquibase.org/xml/ns/dbchangelog":modifySql}' is expected.
versions used: liquibase-3.6.3 and liquibase-modify-column-3.1.jar
POM.xml
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.6.3</version>
<dependencies>
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-modify-column</artifactId>
<version>3.1</version>
</dependency>
</dependencies>
</plugin>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd
http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="Administrator" id="20" runOnChange="true">
<ext:modifyColumn tableName="TEST_TABLE">
<column name="FIELD_NAME" type="java.sql.Types.VARCHAR(250)" />
</ext:modifyColumn>
</changeSet>
</databaseChangeLog>
adding liquibase-modify-column.jar in liqubase dependency and using
ext:modifyColumn </ext:modifyColumn>
will make to use modifyColumn functional with latest liquibase
https://forum.liquibase.org/t/custom-preconditions-as-an-extension-not-working/1428
<modifyColumn> is not allowed where you placed it. As far as I can see in the docs <modifyColumn> is no valid data type at all for liquibase. Instead you'll have to put any of the tags the error message mentions. You should check https://docs.liquibase.com/change-types/home.html for a list of valid Change Types that can be used under <changeSet>. Based on what you put into your <modifyColumn> tag I guess you're looking for the modifyDataType.
I am developing a JPA application which requires to be able to access different schemas on the same database (i.e. DB2/Oracle). I want all of my entities to be registered in the persistence.xml file (<class>) and be able to define which ones belong to certain schemas.
I know it is possible to use java annotations, however this is a product which will need the end user to configure that accordingly (hence why I want to be able to achieve this in an xml file).
Currently I have found an example like this:
orm.xml
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
version="2.0">
<persistence-unit-metadata>
<persistence-unit-defaults>
<schema>SECURITY</schema>
</persistence-unit-defaults>
</persistence-unit-metadata>
</entity-mappings>
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="jpa.sample.plain">
<mapping-file>custom-orm.xml</mapping-file>
<class>com.reds.model.Role</class>
<class>com.reds.model.User</class>
<properties>
<property name="javax.persistence.target-database" value="PostgreSQL" />
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://127.0.0.1:5432/security" />
<property name="javax.persistence.jdbc.user" value="user" />
<property name="javax.persistence.jdbc.password" value="password" />
<!-- EclipseLink should create the database schema automatically -->
<property name="eclipselink.ddl-generation" value="none" />
<property name="eclipselink.weaving" value="false" />
<!-- <property name="eclipselink.ddl-generation.output-mode"
value="database" /> -->
<property name="eclipselink.logging.level" value="INFO"/>
</properties>
</persistence-unit>
</persistence>
In the above files, from my understanding the schema "SECURITY" is set on the persistence unit that includes the orm.xml mapping file (makes it the default which an annotation can change?). But this makes the schema be implicitly "SECURITY" for both classes listed in persistence.xml.
Contrary to the above I need:
A way to list the schema on a subset of classes in a persistence unit in an efficient way (unless if the only way is to do the entity mappings manually in the orm.xml which is something I wish to avoid and the end user would too)
Keep this away from vendor specific xml files or java implementations if possible (keep to JPA standard)
Side question: Would this allow a JPQL query to go through transparently for 2 entities with different schemas?
Details of project:
Hibernate 5.1, JPA 2.1
DB2/Oracle
EDIT:
I found this link which helped me set up my orm.xml: https://docs.jboss.org/hibernate/stable/annotations/reference/en/html/xml-overriding.html
Posted below is the most relevant excerpt:
3.1.2. Entity level metadata
You can either define or override metadata informations on a given entity.
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappin(1)gs
xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
version="2.0">
<package>o(2)rg.hibernate.test.annotations.reflection</package>
<entity cl(3)ass="Administration" access="PROPERTY" metadata-complete="true">
<table(4) name="tbl_admin">
<unique-constraint>
<column-name>firstname</column-name>
<column-name>lastname</column-name>
</unique-constraint>
</table>
<secon(5)dary-table name="admin2">
<primary-key-join-column name="admin_id" referenced-column-name="id"/>
<unique-constraint>
<column-name>address</column-name>
</unique-constraint>
</secondary-table>
<id-cl(6)ass class="SocialSecurityNumber"/>
<inher(7)itance strategy="JOINED"/>
<seque(8)nce-generator name="seqhilo" sequence-name="seqhilo"/>
<table(9)-generator name="table" table="tablehilo"/>
...
</entity>
<entity class="PostalAdministration">
<prima(10)ry-key-join-column name="id"/>
...
</entity>
</entity-mappings>
1 entity-mappings: entity-mappings is the root element for all XML files. You must declare the xml schema, the schema file is included in the hibernate-annotations.jar file, no internet access will be processed by Hibernate Annotations.
2 package (optional): default package used for all non qualified class names in the given deployment descriptor file.
3 entity: desribes an entity.
metadata-complete defines whether the metadata description for this element is complete or not (in other words, if annotations present at the class level should be considered or not).
An entity has to have a class attribute refering the java class the metadata applies on.
You can overrides entity name through the name attribute, if none is defined and if an #Entity.name is present, then it is used (provided that metadata complete is not set).
For metadata complete (see below) element, you can define an access (either FIELD or PROPERTY (default)). For non medatada complete element, if access is not defined, the #Id position will lead position, if access is defined, the value is used.
4 table: you can declare table properties (name, schema, catalog), if none is defined, the java annotation is used.
You can define one or several unique constraints as seen in the example
5 secondary-table: defines a secondary table very much like a regular table except that you can define the primary key / foreign key column(s) through the primary-key-join-column element. On non metadata complete, annotation secondary tables are used only if there is no secondary-table definition, annotations are ignored otherwise.
6 id-class: defines the id class in a similar way #IdClass does
7 inheritance: defines the inheritance strategy (JOINED, TABLE_PER_CLASS, SINGLE_TABLE), Available only at the root entity level
8 sequence-generator: defines a sequence generator
9 table-generator: defines a table generator
10 primary-key-join-column: defines the primary key join column for sub entities when JOINED inheritance strategy is used
No, you can't do this via the orm.xml or persistence.xml files.
That said, you can do something similar by specifying the non-standard schema in your #Table annotation on each individual persistence object.
#Entity
#Table(name = "PERSON", schema="SOME_OTHER_SCHEMA")
public class Person {
. . .
}
Is there a way, to instruct Maven Surefire, to save the test starting time of each JUnit Test Case in the report xml file?
I expect that the report should look a bit like this:
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="com.chris.testcases.Timestamp" time="1,962.965" tests="1" errors="0" skipped="0" failures="0">
<properties>
<property ...>
</properties>
<testcase
name="Timestampfilter"
classname="com.chris.testcases.Timestamp"
time="1,339.383" <-- this is the already existing execution time
--> timestamp="2015-03-11 16:44:05" /> <-- this is the NEW attribute I need
...
</testsuite>
Background: I need this paramter for future processing in this xml, and just writing the timestamp in the "normal" logfile/output is no solution.
I am using: Maven 3.2.5 with Surefire-Plugin 2.18.1.
Update: I found an similar question here: https://jira.codehaus.org/browse/SUREFIRE-681