Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flyway-maven-plugin to plugins and update flyway related configuration #6159

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stweil
Copy link
Member

@stweil stweil commented Jul 30, 2024

  • fix dependency
  • use main.basedir instead of basedir in path of flyway.properties and update url

This allows running mvn flyway:migrate from the source root directory.

…ation

- fix dependency
- use main.basedir instead of basedir in path of flyway.properties and update url

This allows running `mvn flyway:migrate` from the source root directory.

Signed-off-by: Stefan Weil <[email protected]>
Copy link
Collaborator

@henning-gerhardt henning-gerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure about this pull request: Yes, it fixed some issues (old wrong dependency location, other basedir directory, needed new depedency for new flyway versions) but missed some parts (identical content in two files and one file is copied to the other on CI execution) and even made the flyway execution general available without the flyway profile.

With and without the profile and even without the configuration duplication: if you execute any flyway command then from the main directory the flyway command are executed for every defined module. So running a mvn flyway:info from the main directory would not display the information once no it is currently 15 times :-(

If you want it only once then you must change in the Kitodo-DataManagement module and run the command from there which then needs a local adjusted flyway.properties file for the flyway.locations configuration parameter (the path information here is depending on where the flyway command is executed - the line / option would look like without your changes).

I don't know which goals for which usage scenarios should be supported or not but I have the opinion that we had a lot of goals with a lot of usage scenarios on different places and no one knows which of them are supported and which not.

Comment on lines -3 to +4
flyway.url=jdbc:mysql://localhost/kitodo?useSSL=false
flyway.locations=filesystem:../Kitodo-DataManagement/src/main/resources/db/migration
flyway.url=jdbc:mysql://localhost/kitodo
flyway.locations=filesystem:Kitodo-DataManagement/src/main/resources/db/migration
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this changes come in than this file and flyway.properties.actions are identical and the copying while CI execution is not needed anymore which is resulting in deleting the copy line in the CI workflow file and the deleting of the flyway.properties.action file.

Comment on lines +846 to +876
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>${flyway-maven-plugin.version}</version>
<configuration>
<configFiles>
<!-- local configuration file -->
<!--<configFile>${main.basedir}/config-local/flyway.properties</configFile>-->
<configFile>
${main.basedir}/Kitodo-DataManagement/src/main/resources/db/config/flyway.properties
</configFile>
</configFiles>
</configuration>
<dependencies>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>${mysql.version}</version>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-mysql</artifactId>
<version>${flyway-maven-plugin.version}</version>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>${mariadb-java-client.version}</version>
</dependency>
</dependencies>
</plugin>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are coping the whole existing flyway profile and made the flyway execution available without the flyway profile. I don't know is this correct and wanted. In my opinion the flyway execution should only be possible if you add the flyway profile to the maven command and not without this profile.

Only one change is needed in the flyway profile: the adding of the new dependency org.flyway:flyway-mysql. Both other dependencies are already defined in the profile dependency.

Comment on lines -1027 to +1059
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this overseen old mysql dependency location which cause trouble in #6205 . I had overseen this in #5849.

Copy link
Member Author

@stweil stweil Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@henning-gerhardt, @solth, how should we proceed with this pull request? Would you prefer a separate PR for mysql-connector-j?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a solution like in #6230 for the 3.7.x release branch as the change is needed for more recent MySQL versions too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants