I'm developing a Spring application where everything is configured with maven (in pom.xml
). My application uses a PostgreSQL database, but unit tests use an in-memory HSQLDB database.
I just run into an issue with TEXT
columns because they are not supported natively by HSQLDB. In my entity class I have :
private @Column(columnDefinition = "text") String propertyName;
This works fine with Postgres, but HSQLDB is generating the following error : type not found or user lacks privilege: TEXT
. The table is not created, and of course as a result most of my tests fail.
I found that I need to activate PostgreSQL compatibility in order for this to work by setting sql.syntax_pgs
to true
.
My question is : where do I put this setting ? I would like to put it in pom.xml
because everything is configured there, but I don't know where.
For exemple I have :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Dspring.profiles.active=test</argLine>
</configuration>
</plugin>
Can I somehow add an <argLine>
with this setting ?