powsybl-parent-ws
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-parent-ws</artifactId>
<version>25</version>
</dependency><?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2019, RTE (http://www.rte-france.com)
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<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>
<parent>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-parent</artifactId>
<version>25</version>
</parent>
<artifactId>powsybl-parent-ws</artifactId>
<packaging>pom</packaging>
<name>Powsybl Parent WS</name>
<description>Powsybl Parent for Web Services</description>
<properties>
<maven.jib.version>3.4.4</maven.jib.version>
<maven.spring-boot.version>3.3.3</maven.spring-boot.version>
<!--
For simplicity, we keep git-commit-id in sync with springboot
to behave like spring-boot-starter-parent
-->
<maven.git-commit-id.version>8.0.2</maven.git-commit-id.version>
<jib.from.image>powsybl/java:3.0.0</jib.from.image>
<!--
SPRING_PROFILES_ACTIVE: remove extra profiles. This is used for example to remove the "local" profile
which allows running apps in an IDE and have it connect to localhost for its dependencies
SPRING_CONFIG_LOCATION: change the working dir from spring config location to /config. The working dir
is RW in /home, while the config is RO in /config. Keep the other spring default locations.
NOTE: using a single line without whitespace to avoid messing up the environment
-->
<jib.container.environment>SPRING_PROFILES_ACTIVE=default,SPRING_CONFIG_LOCATION=optional:classpath:/;optional:classpath:/config/;optional:file:/config/;optional:file:/config/*/</jib.container.environment>
<!-- copied from spring-boot-starter-parent -->
<maven.resource.delimiter>@</maven.resource.delimiter>
<maven.compiler.parameters>true</maven.compiler.parameters>
<git-id.offline>true</git-id.offline>
<git-id.failOnNoGitDirectory>false</git-id.failOnNoGitDirectory>
<git-id.failOnUnableToExtractRepoInfo>false</git-id.failOnUnableToExtractRepoInfo>
<!-- for liquibase plugin -->
<liquibase-core.version>4.20.0</liquibase-core.version>
<!--
liquibase-hibernate6 4.20 (the same as liquibase-core) generates useless changesets, 4.23.2 doesn't seem to have this problem.
for example, but maybe there are more
existing
<column name="mystr" type="VARCHAR(255)">
still generates
<modifyDataType columnName="mystr" newDataType="varchar(255)"/>
existing
<column name="mydate" type="TIMESTAMP">
still generates
<modifyDataType columnName="mydate" newDataType="timestamp(6)"/>
existing
<column name="myuuid" type="UUID">
still generates
<modifyDataType columnName="myuuid" newDataType="bytea"/>
Switching to liquibase-hibernate.version 4.26.0, which includes resolving the issue where it attempted to connect to the database during changelog generation.
This connection issue has been corrected in version 4.26.0, along with potential additional bug fixes and enhancements.
-->
<liquibase-hibernate.version>4.26.0</liquibase-hibernate.version>
<validation-api.version>3.0.2</validation-api.version>
<liquibase-diff.outputFile>src/main/resources/db/changelog/changesets/changelog_${maven.build.timestamp}.xml</liquibase-diff.outputFile>
<liquibase.username>sa</liquibase.username>
<liquibase.databaseDriver>org.h2.Driver</liquibase.databaseDriver>
<liquibase.databaseUrl>jdbc:h2:./target/dummyDB</liquibase.databaseUrl>
<liquibase.referenceDatabaseUrl>hibernate:spring:${liquibase-hibernate-package}?dialect=org.hibernate.dialect.PostgreSQLDialect&hibernate.physical_naming_strategy=org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy</liquibase.referenceDatabaseUrl>
<liquibase.referenceDatabaseDriver>liquibase.ext.hibernate.database.connection.HibernateDriver</liquibase.referenceDatabaseDriver>
<liquibase-hibernate-package>PROPERTY_TO_BE_DEFINED_IN_PROJECTS</liquibase-hibernate-package>
</properties>
<build>
<!-- copied from spring-boot-starter-parent -->
<resources>
<resource>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/application*.yml</include>
<include>**/application*.yaml</include>
<include>**/application*.properties</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<excludes>
<exclude>**/application*.yml</exclude>
<exclude>**/application*.yaml</exclude>
<exclude>**/application*.properties</exclude>
</excludes>
</resource>
</resources>
<!--
by default jib uses artifactId:artifactVersion for its to.image.name
For example, it would use "powsybl-case-server". We want "powsybl/case-server".
we also want to omit the version to use latest for snapshots but not for releases
-->
<!-- Note: this is executed even for this pom but does nothing, the value is not inherited by child projects. so we don't care. -->
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>bsh-property</goal>
</goals>
<configuration>
<properties>
<property>jib.to.image</property>
</properties>
<source>
String useJibDefaultName =
session.getUserProperties().getProperty("powsybl.docker.useJibDefaultName",
project.getProperties().getProperty("powsybl.docker.useJibDefaultName",
"false"));
String image =
session.getUserProperties().getProperty("image",
project.getProperties().getProperty("image"));
String jibtoimage =
session.getUserProperties().getProperty("jib.to.image",
project.getProperties().getProperty("jib.to.image"));
String finalName;
if ("false".equals(useJibDefaultName) @and null == image @and null == jibtoimage) {
String name;
String keepArtifactName =
session.getUserProperties().getProperty("powsybl.docker.keepArtifactName",
project.getProperties().getProperty("powsybl.docker.keepArtifactName",
"false"));
if ("false".equals(keepArtifactName)) {
name = project.artifactId.replaceFirst("-","/");
} else {
name = project.artifactId; //the default
}
String keepSnapshotVersion =
session.getUserProperties().getProperty("powsybl.docker.keepSnapshotVersion",
project.getProperties().getProperty("powsybl.docker.keepSnapshotVersion",
"false"));
if (!"false".equals(keepSnapshotVersion) @or !project.version.endsWith("-SNAPSHOT")) {
name = name + ":" + project.version;
}
print("Setting jib.to.image to " + name);
finalName = name;
} else {
// we have to set this to something otherwise we get an exception
print("Not setting jib.to.image because powsybl.docker.useJibDefaultName or jib.to.image or image is set.");
finalName = jibtoimage;
}
jib.to.image = finalName;
</source>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>${liquibase-core.version}</version>
<configuration>
<changeLogFile>src/main/resources/db/changelog/db.changelog-master.yaml</changeLogFile>
<diffChangeLogFile>${liquibase-diff.outputFile}</diffChangeLogFile>
<referenceUrl>${liquibase.referenceDatabaseUrl}</referenceUrl>
<referenceDriver>${liquibase.referenceDatabaseDriver}</referenceDriver>
<username>${liquibase.username}</username>
<url>${liquibase.databaseUrl}</url>
<driver>${liquibase.databaseDriver}</driver>
</configuration>
<!-- Liquibase dependencies-->
<dependencies>
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-hibernate6</artifactId>
<version>${liquibase-hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>${maven.spring-boot.version}</version>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>${validation-api.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>${maven.jib.version}</version>
<configuration>
<from>
<image>${jib.from.image}</image>
</from>
</configuration>
</plugin>
<!-- copied from spring-boot-starter-parent -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<parameters>${maven.compiler.parameters}</parameters>
</configuration>
</plugin>
<!-- copied from spring-boot-starter-parent -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<delimiters>
<delimiter>${maven.resource.delimiter}</delimiter>
</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${maven.spring-boot.version}</version>
<executions>
<execution>
<id>build-info</id>
<goals>
<goal>build-info</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- copied from spring-boot-starter-parent -->
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<version>${maven.git-commit-id.version}</version>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<offline>${git-id.offline}</offline>
<dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<failOnNoGitDirectory>${git-id.failOnNoGitDirectory}</failOnNoGitDirectory>
<failOnUnableToExtractRepoInfo>${git-id.failOnUnableToExtractRepoInfo}</failOnUnableToExtractRepoInfo>
<gitDescribe><tags>true</tags></gitDescribe>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<activation>
<property>
<name>powsybl.spring-boot.skip</name>
<value>!true</value>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<attach>false</attach>
<classifier>exec</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>jibpackagedocker</id>
<activation>
<property>
<name>powsybl.docker.package</name>
<value>true</value>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<executions>
<execution>
<id>jibDockerPackage</id>
<phase>package</phase>
<goals>
<goal>buildTar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>jibinstalldocker</id>
<activation>
<property>
<name>powsybl.docker.install</name>
<value>true</value>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<executions>
<execution>
<id>jibDockerBuild</id>
<phase>install</phase>
<goals>
<goal>dockerBuild</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>jibdeploydocker</id>
<activation>
<property>
<name>powsybl.docker.deploy</name>
<value>true</value>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<executions>
<execution>
<id>jibDockerDeploy</id>
<phase>deploy</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>powsyblliquibase</id>
<activation>
<property>
<name>powsybl.liquibase.generate</name>
<value>!false</value>
</property>
</activation>
<properties>
<maven.build.timestamp.format>yyyyMMdd'T'HHmmssX</maven.build.timestamp.format>
</properties>
</profile>
</profiles>
</project>