我想使用 celerio从我们的数据库中生成代码。Celerio 使用sql-maven-plugin连接到数据库。但我无法解决 ingres 驱动程序的依赖关系。
这就是我在 celerio 项目的 pom.xml 中设置数据库连接的方式
<!-- ingres jdbc driver -->
<jdbc.groupId>ingres</jdbc.groupId>
<jdbc.artifactId>ingres-connector-java</jdbc.artifactId>
<jdbc.version>10.0-4.0.6</jdbc.version>
<!-- ingres jdbc settings -->
<jdbc.driver>com.ingres.jdbc.IngresDriver</jdbc.driver>
<jdbc.url>jdbc:ingres://bjax:/entw_frm_db</jdbc.url>
<jdbc.user>ingres</jdbc.user>
<jdbc.password></jdbc.password>
<jdbc.catalog></jdbc.catalog>
<hibernate.dialect>org.hibernate.dialect.IngresDialect</hibernate.dialect>
<sql-maven-plugin.delimiter>;</sql-maven-plugin.delimiter>
但是当我尝试让 codegen 运行时>mvn -Pdb,metadata,gen
,我得到了这个异常:
[ERROR] Failed to execute goal org.codehaus.mojo:sql-maven-plugin:1.5:execute (Create and initialize the database) on project book_application: Execution Create
and initialize the database of goal org.codehaus.mojo:sql-maven-plugin:1.5:execute failed: Plugin org.codehaus.mojo:sql-maven-plugin:1.5 or one of its dependen
cies could not be resolved: Failed to collect dependencies at org.codehaus.mojo:sql-maven-plugin:jar:1.5 -> ingres:ingres-connector-java:jar:10.0-4.0.6: Failed
to read artifact descriptor for ingres:ingres-connector-java:jar:10.0-4.0.6: Could not transfer artifact ingres:ingres-connector-java:pom:10.0-4.0.6 from/to Cod
ehaus Snapshots (https://nexus.codehaus.org/content/repositories/releases): Failed to transfer file: https://nexus.codehaus.org/content/repositories/releases/in
gres/ingres-connector-java/10.0-4.0.6/ingres-connector-java-10.0-4.0.6.pom. Return code is: 502 , ReasonPhrase:Bad Gateway. -> [Help 1]
注意:我尝试使用 mysql 运行代码生成,我完全没有问题(但使用 mysql 不是选项,因为这只是一个测试 - 我们的客户数据库是一个 ingres 数据库)