Skip to content

Commit

Permalink
NO_ISSUE: Copying resources directly to target instead to `src/main…
Browse files Browse the repository at this point in the history
…/resources` to keep module sources clean. (apache#3691)

* NO_ISSUE: Copying resources directly to `target` instead to `src/main/resources` to keep module sources clean.

* - fix formatting

* - renamed path variables

* - format
  • Loading branch information
pefernan authored and rgdoliveira committed Oct 10, 2024
1 parent 7634ecc commit adb145d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 37 deletions.
20 changes: 0 additions & 20 deletions addons/common/persistence/postgresql/.gitignore

This file was deleted.

25 changes: 8 additions & 17 deletions addons/common/persistence/postgresql/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
Expand Down Expand Up @@ -31,9 +31,10 @@
<description>PostgreSQL based persistence for KIE</description>
<properties>
<path.to.jdbc.addon>../jdbc</path.to.jdbc.addon>
<path.to.script.folder>src/main/resources/kie-flyway/db/</path.to.script.folder>
<path.to.migration.scripts.from>${path.to.jdbc.addon}/${path.to.script.folder}/persistence-jdbc/postgresql</path.to.migration.scripts.from>
<path.to.migration.scripts.to>${path.to.script.folder}/persistence-postgresql/postgresql</path.to.migration.scripts.to>
<path.to.flyway.location>kie-flyway/db</path.to.flyway.location>
<path.to.script.folder>src/main/resources/${path.to.flyway.location}/persistence-jdbc/postgresql</path.to.script.folder>
<path.to.migration.scripts.source>${path.to.jdbc.addon}/${path.to.script.folder}</path.to.migration.scripts.source>
<path.to.migration.scripts.target>target/classes/${path.to.flyway.location}/persistence-postgresql/postgresql</path.to.migration.scripts.target>
<java.module.name>org.kie.kogito.persistence.postgresql</java.module.name>
</properties>

Expand Down Expand Up @@ -117,17 +118,7 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${path.to.script.folder}</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<!-- The cleanest way would be to use the maven-dependency-plugin to unpack and copy scripts from the built artifact `kie-addons-persistence-jdbc` but there's a limitation to using this only in the `package` phase whereas we need that into the `generate-sources` phase. See also https://issues.apache.org/jira/browse/MDEP-98 -->
<!-- The cleanest way would be to use the maven-dependency-plugin to unpack and copy scripts from the built artifact `kie-addons-persistence-jdbc` but there's a limitation to using this only in the `package` phase whereas we need that into the `generate-sources` phase. See also https://issues.apache.org/jira/browse/MDEP-98 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand All @@ -139,10 +130,10 @@
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${path.to.migration.scripts.to}</outputDirectory>
<outputDirectory>${path.to.migration.scripts.target}</outputDirectory>
<resources>
<resource>
<directory>${path.to.migration.scripts.from}</directory>
<directory>${path.to.migration.scripts.source}</directory>
</resource>
</resources>
</configuration>
Expand Down

0 comments on commit adb145d

Please sign in to comment.