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

flyway:migrate complains about missing URL even when execution should be skipped #576

Closed
pimlottc opened this issue Aug 8, 2013 · 7 comments
Closed
Labels
Milestone

Comments

@pimlottc
Copy link

@pimlottc pimlottc commented Aug 8, 2013

The flyway:migrate goal should not complain about missing properties when skip is true.

Example POM:

<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.googlecode.flyway</groupId>
  <artifactId>flyway-test</artifactId>
  <version>1.0</version>

  <packaging>pom</packaging>
  <name>flyway-test</name>

  <build>
    <plugins>
        <plugin>
          <groupId>com.googlecode.flyway</groupId>
          <artifactId>flyway-maven-plugin</artifactId>
          <version>2.2</version>
          <configuration>
            <skip>true</skip>
          </configuration>
        </plugin>
    </plugins>
  </build>
</project>
[ERROR] Failed to execute goal com.googlecode.flyway:flyway-maven-plugin:2.2:migrate (default-cli) on project flyway-test: The parameters 'url' for goal com.googlecode.flyway:flyway-maven-plugin:2.2:migrate are missing or invalid -> [Help 1]
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Aug 9, 2013

Thanks for your report. What is the specific real world use-case where such a constellation would apply?

@pwielgolaski
Copy link
Contributor

@pwielgolaski pwielgolaski commented Aug 9, 2013

we have similar configuration in multiproject setup when in parent pom we have skip=true and in child poms we have skip=false.

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Aug 9, 2013

Isn't pluginManagement meant for these cases?

@pimlottc
Copy link
Author

@pimlottc pimlottc commented Aug 9, 2013

I should have mentioned, in our setup, we explicitly invoke the flyway:migrate goal on the command line to update our individual dev databases, from the top-level pom:

mvn initialize flyway:migrate

It's a large project, and not all the modules have migration scripts, so we don't always want to run the migrate goal.

Putting it the configuration in pluginManagement doesn't help since the goal is explicitly invoked. It'll pick up the configuration but the original issue still arises.

@pimlottc
Copy link
Author

@pimlottc pimlottc commented Aug 9, 2013

With pluginManagement:

<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.googlecode.flyway</groupId>
  <artifactId>flyway-test</artifactId>
  <version>1.0</version>

  <packaging>pom</packaging>
  <name>flyway-test</name>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.googlecode.flyway</groupId>
          <artifactId>flyway-maven-plugin</artifactId>
          <version>2.2</version>
          <configuration>
            <skip>true</skip>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>
$ mvn -o flyway:migrate
...
[ERROR] Failed to execute goal com.googlecode.flyway:flyway-maven-plugin:2.2:migrate (default-cli) on project flyway-test: The parameters 'url' for goal com.googlecode.flyway:flyway-maven-plugin:2.2:migrate are missing or invalid -> [Help 1]
@pwielgolaski
Copy link
Contributor

@pwielgolaski pwielgolaski commented Aug 14, 2013

It seems that in documentation generated by maven plugin url is marked as required and it causes the problem.

Alex, what do you think about relaxing this required statement, but in this way you can define plugin without configuration parameters.

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Aug 31, 2013

Constraint relaxed and validation moved to DataSource, in case it gets created (not if skip=true).

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
3 participants
You can’t perform that action at this time.