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

Remove warning when using flyway.version maven property #1348

Closed
squawk979 opened this issue Jun 21, 2016 · 12 comments
Closed

Remove warning when using flyway.version maven property #1348

squawk979 opened this issue Jun 21, 2016 · 12 comments
Labels
Milestone

Comments

@squawk979
Copy link

@squawk979 squawk979 commented Jun 21, 2016

What version of Flyway are you using? 4.0.3
What database are you using (type & version)? MySQL 5.6
What operating system are you using? Windows 10
What did you do? built using the flyway-maven-plugin
What did you expect to see? no warnings
What did you see instead? [WARNING] Unknown configuration property: flyway.version

There's actually no problem, but the warning made me think there was and threw me for a while. I use a number of maven properties called flyway.whatever. For example let's take flyway.version. At the top of the POM:

<properties>
    <flyway.version>4.0.3</flyway.version>
</properties>

and later in the dependencies:

  <dependency>
        <groupId>org.flywaydb</groupId>
        <artifactId>flyway-core</artifactId>
        <version>${flyway.version}</version>
    </dependency>

The flyway maven plugin passes all properties into core flyway which then filters them and logs a warning because it has a property starting with "flyway." that it doesn't recognize. Of course it's not a problem at all, it was used correctly by maven and was never intended for flyway core.

Might be worth considering whether this kind of warning should be printed. Realize that it's helpful in scenarios where a user may have intended a genuine flyway setting but got the name wrong. I'm really not sure what the best course of action is. Any thoughts?

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Jun 21, 2016

This works as designed for the reason you mentioned.

We could however add an exception for flyway.version as this is really a common pattern on the Maven side of things.

@jeromerg
Copy link

@jeromerg jeromerg commented Jun 21, 2016

I get the warning even if maven doesn't contain any property "flyway.version".

It would be nice, to lower the logging level: Every developer spends half an hour to try to remove this warning and to figure out, that it is a false positive. ;-)

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Jun 21, 2016

@jeromerg I promise you, somewhere your Maven build contains a definition for that property. No warning is generated out of thin air...

@squawk979
Copy link
Author

@squawk979 squawk979 commented Jun 21, 2016

... spring boot dependencies defines flyway.version for example...

@jeromerg
Copy link

@jeromerg jeromerg commented Jun 21, 2016

Indeed it is certainly spring-boot depedencies. Thank you for the explanation. Does it help to solve the issue? Is there any mean to remove the warning at my pom's level?

@axelfontaine axelfontaine changed the title warning when using flyway.x maven properties Remove warning when using flyway.version maven property Jun 21, 2016
@squawk979
Copy link
Author

@squawk979 squawk979 commented Jun 22, 2016

I think Axel's suggestion above is a good idea: it's a minimal change but will remove the unnecessary warning (for flyway.version) people are likely to see. I'd wait for that change and put up with the warning for now

@jeromerg
Copy link

@jeromerg jeromerg commented Jun 22, 2016

Thank you for your help!

@Jelledb
Copy link

@Jelledb Jelledb commented Aug 12, 2016

I'm also getting the warning without specifying the flyway.version property. I am using Spring Boot.

@abuabdul
Copy link

@abuabdul abuabdul commented Sep 18, 2016

Im using flyway version 4.0.2. I just renamed maven properties to flywaydb.version. guess what? I see no more warning. Thanks @axelfontaine

@narwajea
Copy link

@narwajea narwajea commented Nov 8, 2016

When using Spring Boot, you may inherit from spring-boot-starter-parent, which in turn inherits the "flyway.version" property from spring-boot-dependencies.

@SingleShot
Copy link

@SingleShot SingleShot commented Nov 19, 2016

I am not aware of any other plugin that logs warnings of this nature. I'd like to see it removed.

axelfontaine added a commit to flyway/flywaydb.org that referenced this issue Jan 25, 2017
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Jan 25, 2017

Fixed.

@axelfontaine axelfontaine added t: bug and removed t: feature labels Jan 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.