- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想就 sql-mvn-plugin 寻求帮助.根据documentation如果 pom.xml 文件没有关于文件顺序的任何信息 - orderFile 标记 - 则文件将按照它们列出的确切顺序执行。但事实并非如此!如果我删除 orderFile 标记,则默认情况下文件将按升序执行。
老实说,我想在安装过程中使用这个插件来创建数据库和导入数据。由于我正在处理 20 多个表 - 脚本、表、序列和约束被分成单独的文件 - 我无法处理没有有意义名称的文件。这本身就是 hell ,使用这个插件将毫无值(value)。另一方面,我不想在 maven 之外进行这一步,因为在我看来 maven 是构建、测试和部署我的应用程序的工具,也是避免脚本 hell 的工具。
正如您在下面的示例中看到的那样,执行顺序未定义,尽管在执行期间执行了第一个文件 *procedures/test_activate_all_partners.sql*,它是文件顺序中的倒数第二个!根据我的理解,第一个执行的文件应该是 *tables/datapoint_component_types/table.sql*。
我的 pom.xml:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<version>1.5</version>
<dependencies>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901.jdbc4</version>
</dependency>
</dependencies>
<configuration>
<driver>org.postgresql.Driver</driver>
<url>jdbc:postgresql://localhost:5432/database</url>
<username>postgres</username>
<password>postgres</password>
</configuration>
<executions>
<execution>
<id>default-cli</id>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<delimiter>/</delimiter>
<delimiterType>normal</delimiterType>
<autocommit>true</autocommit>
<fileset>
<!-- at home -->
<basedir>d:/PRIVAT/Projects/java/bigProject/</basedir>
<includes>
<!-- tables -->
<include>tables/datapoint_component_types/table.sql</include>
<include>tables/datapoint_datapoint_components/table.sql</include>
<include>tables/datapoint_java_result_types/table.sql</include>
<include>tables/datapoint_postgres_result_types/table.sql</include>
<include>tables/datapoint_result_types/table.sql</include>
<include>tables/datapoints/table.sql</include>
<include>tables/datatype_descs/table.sql</include>
<include>tables/datatypes/table.sql</include>
<include>tables/disabled_period/table.sql</include>
<include>tables/file_extensions/table.sql</include>
<include>tables/logs/table.sql</include>
<include>tables/partner_datatypes/table.sql</include>
<include>tables/partner_processes/table.sql</include>
<include>tables/partner_protocols/table.sql</include>
<include>tables/partner_protocols_attributes_details/table.sql</include>
<include>tables/partners/table.sql</include>
<include>tables/process_step/table.sql</include>
<include>tables/process_step_actions/table.sql</include>
<include>tables/process_steps_param/table.sql</include>
<include>tables/process_steps_partner_processes/table.sql</include>
<include>tables/processes/table.sql</include>
<include>tables/protocol_attributes/table.sql</include>
<include>tables/protocols/table.sql</include>
<include>tables/result_tables/table.sql</include>
<include>tables/valid_period/table.sql</include>
<!-- constrains -->
<include>tables/datapoint_component_types/sequences.sql</include>
<include>tables/datapoint_datapoint_components/sequences.sql</include>
<include>tables/datapoint_java_result_types/sequences.sql</include>
<include>tables/datapoint_postgres_result_types/sequences.sql</include>
<include>tables/datapoint_result_types/sequences.sql</include>
<include>tables/datapoints/sequences.sql</include>
<include>tables/datatype_descs/sequences.sql</include>
<include>tables/datatypes/sequences.sql</include>
<include>tables/disabled_period/sequences.sql</include>
<include>tables/file_extensions/sequences.sql</include>
<include>tables/logs/sequences.sql</include>
<include>tables/partner_datatypes/sequences.sql</include>
<include>tables/partner_processes/sequences.sql</include>
<include>tables/partner_protocols/sequences.sql</include>
<include>tables/partner_protocols_attributes_details/sequences.sql</include>
<include>tables/partners/sequences.sql</include>
<include>tables/process_step/sequences.sql</include>
<include>tables/process_step_actions/sequences.sql</include>
<include>tables/process_steps_param/sequences.sql</include>
<include>tables/process_steps_partner_processes/sequences.sql</include>
<include>tables/processes/sequences.sql</include>
<include>tables/protocol_attributes/sequences.sql</include>
<include>tables/protocols/sequences.sql</include>
<include>tables/result_tables/sequences.sql</include>
<include>tables/valid_period/sequences.sql</include>
<!-- sequences -->
<include>tables/datapoint_component_types/constraints.sql</include>
<include>tables/datapoint_datapoint_components/constraints.sql</include>
<include>tables/datapoint_java_result_types/constraints.sql</include>
<include>tables/datapoint_postgres_result_types/constraints.sql</include>
<include>tables/datapoint_result_types/constraints.sql</include>
<include>tables/datapoints/constraints.sql</include>
<include>tables/datatype_descs/constraints.sql</include>
<include>tables/datatypes/constraints.sql</include>
<include>tables/disabled_period/constraints.sql</include>
<include>tables/file_extensions/constraints.sql</include>
<include>tables/logs/constraints.sql</include>
<include>tables/partner_datatypes/constraints.sql</include>
<include>tables/partner_processes/constraints.sql</include>
<include>tables/partner_protocols/constraints.sql</include>
<include>tables/partner_protocols_attributes_details/constraints.sql</include>
<include>tables/partners/constraints.sql</include>
<include>tables/process_step/constraints.sql</include>
<include>tables/process_step_actions/constraints.sql</include>
<include>tables/process_steps_param/constraints.sql</include>
<include>tables/process_steps_partner_processes/constraints.sql</include>
<include>tables/processes/constraints.sql</include>
<include>tables/protocol_attributes/constraints.sql</include>
<include>tables/protocols/constraints.sql</include>
<include>tables/result_tables/constraints.sql</include>
<include>tables/valid_period/constraints.sql</include>
<!-- procedures -->
<include>procedures/test_activate_all_partners.sql</include>
<!-- testdata -->
<include>testdata/data.sql</include>
</includes>
</fileset>
</configuration>
</execution>
</executions>
</plugin>
d:/PRIVAT/Projects/java/bigProject>mvn sql:execute
[INFO] Scanning for projects...
...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building EJB 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sql-maven-plugin:1.5:execute (default-cli) @ DiLibCoreEJB ---
[INFO] Executing file: sql\procedures\test_activate_all_partners.sql
[INFO] Executing file: sql\tables\datapoints\constraints.sql
[ERROR] Failed to execute:
ALTER TABLE
datapoints
ADD
CONSTRAINT datapoints_pkey PRIMARY KEY (datapoint_id );
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.503s
[INFO] Finished at: Sun Jan 06 17:49:40 CET 2013
[INFO] Final Memory: 4M/77M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sql-maven-plugin:1.5:execute (default-cli) on project DiLibCoreEJB: ERROR: relation "datapoints" does not exist -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
d:/PRIVAT/Projects/java/bigProject>
最佳答案
也许我误解了一个东西而是一个 excerpt from the docs说:
File(s) containing SQL statements to load. Only use a Fileset if you want to use ant-like filepatterns, otherwise use
srcFiles
. The order is based on a matching occurrence while scanning the directory (not the order of includes!)
srcFiles
而不是
includes
.意思是这样的:
<configuration>
<srcFiles>
<srcFile>first.sql</srcFile>
<srcFile>second.sql</srcFile>
<srcFile>a.sql</srcFile>
..
</srcFiles>
.
</configuration>
d:/PRIVAT/Projects/java/bigProject/
关于sql-maven-plugin 按照 pom.xml 中列出的确切顺序执行文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14184473/
尝试熟悉 Maven 并参加在线类(class),但陷入困境......感谢提供的任何帮助。 我正在运行站点阶段,虽然它已完成并且我能够在浏览器中实际查看index.html,但我在此过程中遇到了很多
基本上就是标题。。我在任何地方都找不到一个简单的比较,来解释这两者之间的差异:。我知道Gradle中可以有3种类型的插件:。我认为这三种类型的插件在某种程度上与它们可以在settings.gradle
我是 maven 的初学者,现在我对这些 maven 插件之间的区别感到困惑。这些都是创建jar文件吗?现在我的问题是 各个插件创建的jar有什么区别。(组装插件、jar-plugin、shaded插
我使用 tycho-packaging-plugin 来设置 jar 的输出文件夹。这是我的 pom 的缩短版本: 0.21.0 org.eclipse.
When starting the server, refuses to load my plugin with an error:启动服务器时,拒绝加载我的插件,并出现错误: Could n
为什么卸载以下(空)插件会导致错误? 这是my-plugin/my-plugin.php : : my-plugin 关于wordpress - 由于错误 : Could not fully remo
我使用 sbt 与 playframework 和 activator 来构建一个 Web 应用程序。我的 sbt 版本是 0.13.0 我将plugin.sbt 文件更改为: logLevel :=
这是我运行 atlas-create-jira-plugin 时得到的结果后跟 atlas-create-jira-plugin-module选择选项1: Component Import . 问题是
我正在尝试使用 Maven 构建我的 Java 项目,但它失败了,并且出现以下错误: 从存储库 [local (C:\Users\Vinita.Gupta.m2\repository), centra
我正在使用 eclipse mars-2。我想在 Windows 中创建一个新的 Maven Spring Boot 项目。但我遇到了类似 的错误 Could not calculate build
最近开发的产品,我们是有四五个maven模块,开发阶段一直是在eclipse中运行的,然后快发版的时候,需要把这些项目打成jar包,通过命令去启动,那首先就得把这些模块项目打包,或者拷贝一些资源文件等
我想使用 maven-resources-plugin 复制 Excel 并使用 exec-maven-plugin 从该 Excel 创建一些属性文件。并且新创建的属性需要附加到构建中。我可以创建属
当我尝试构建项目时出现此错误。 Errors occurred during the build. Errors running builder 'Maven Project Builder' on
当我在执行 Maven 时从 eclipse 内部 -> 更新项目我遇到以下问题 Unable to update Maven configuration Could not calculate bu
我之前问过一个关于延迟处理事件的问题:Grails non time based queuing .我开始使用 rabbitmq 插件:http://grails.org/plugin/rabbitm
我正在尝试使用 maven 构建一个 java spring 项目(来自 heroku 入门指南的默认项目)。出于某种原因,我不断收到以下错误。机器上网应该没有问题。 Failed to execut
操作系统:OSX 10.11 Cordova :5.4.1(也尝试过 6.0)节点:4.2.6使用的cordova插件:crosswalk-project/cordova-plugin-crosswa
org.sonatype.maven.plugin :emma-maven-plugin:1.2 org.codehaus.mojo :emma-maven-plugin:1.0-alpha-3 or
我正在管理安装了很多插件的多个 shopware 6 商店。后端只允许更新一个插件,这非常耗时,因为更新分两步完成: 更新已加载(加载器圈) 后端已重新加载(html 重新加载) 为什么没有“更新所有
我正在管理安装了很多插件的多个 shopware 6 商店。后端只允许更新一个插件,这非常耗时,因为更新分两步完成: 更新已加载(加载器圈) 后端已重新加载(html 重新加载) 为什么没有“更新所有
我是一名优秀的程序员,十分优秀!