
pro.foundev.cassandra.commons.maven.loader.MojoMigrationLoaderImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cassandra-commons-maven Show documentation
Show all versions of cassandra-commons-maven Show documentation
A very simple Maven Plugin that wires up the migrate step
/*
* Copyright 2015 Ryan Svihla
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package pro.foundev.cassandra.commons.maven.loader;
import pro.foundev.cassandra.commons.migrations.MigrationRunner;
import pro.foundev.cassandra.commons.migrations.MigrationRunnerImpl;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
public class MojoMigrationLoaderImpl implements MojoMigrationLoader {
public void exec(String scriptDirectory, String cassandraYaml) throws IOException {
MigrationRunner runner ;
FileSystem fs = FileSystems.getDefault();
if (scriptDirectory == null) {
throw new FileNotFoundException("missing scriptDirectory parameter in pom.xml");
}
if (cassandraYaml == null) {
throw new FileNotFoundException("missing yamlFileLocation parameter in pom.xml");
}
runner = new MigrationRunnerImpl(cassandraYaml);
runner.runScriptDirectory(fs.getPath(scriptDirectory));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy