简体   繁体   English

Maven pom.xml文件中的JOOQ插件

[英]JOOQ Plugin in Maven pom.xml file

I'm trying to build the example given on the official JOOQ git repo here . 我正在尝试构建此处的官方JOOQ git repo上给出的示例。 The maven pom.xml file contains the following plugin for JOOQ: maven pom.xml文件包含以下用于JOOQ的插件:

 <plugin> <groupId>org.jooq</groupId> <artifactId>jooq-codegen-maven</artifactId> <version>${org.jooq.version}</version> <executions> <execution> <phase>generate-sources</phase> <goals> <goal>generate</goal> </goals> <configuration> <jdbc> <driver>${db.driver}</driver> <url>${db.url}</url> <user>${db.username}</user> <password>${db.password}</password> </jdbc> <generator> <target> <packageName>com.learnd.jooq.db</packageName> <directory>src/main/java</directory> </target> </generator> </configuration> </execution> </executions> </plugin> 

However I'm not managing to mvn compile , the project, and I'm getting the following output because of the ${org.jooq.version} variable in the <version> tag. 但是,由于<version>标记中的${org.jooq.version}变量,我没有设法mvn compile该项目,并且得到了以下输出。 But whenever I've seen this plugin inserted, I've seen it done this way, even here . 但是每当我看到插入此插件时,即使在这里 ,我也看到过这样做。

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.jooq:jooq-spring-example:jar:3.10.0-SNAPSHOT
[WARNING] 'version' contains an expression but should be a constant. @ org.jooq:jooq-spring-example:${org.jooq.version}, /home/lukec/Desktop/jOOQ-spring-example/pom.xml, line 8, column 14
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building jOOQ Spring Example 3.10.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.jooq:jooq-codegen-maven:jar:3.10.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.213 s
[INFO] Finished at: 2017-09-18T03:47:16+02:00
[INFO] Final Memory: 6M/150M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.jooq:jooq-codegen-maven:3.10.0-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact org.jooq:jooq-codegen-maven:jar:3.10.0-SNAPSHOT -> [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/PluginResolutionException

Can anyone help me with this? 谁能帮我这个? Cheers. 干杯。

Its most likely because Maven cant find the jOOQ-codegen-maven 3.10.0-SNAPSHOT version in your local .m2. 这很可能是因为Maven在本地.m2中找不到jOOQ-codegen-maven 3.10.0-SNAPSHOT版本。 I checked the link from your question and I see the spring project and its dependent project jOOQ-codegen-maven in this link, https://github.com/jOOQ/jOOQ/blob/master/jOOQ-codegen-maven/pom.xml , so import this and build it, so that this version gets into your local .m2. 我检查了您问题的链接,然后在此链接https://github.com/jOOQ/jOOQ/blob/master/jOOQ-codegen-maven/pom中看到了spring项目及其相关项目jOOQ-codegen-maven 。 xml ,因此请导入并构建它,以便此版本进入您的本地.m2。 And I see jOOQ-codegen-maven project has a parent jooq-parent, so you will probably need to build that as well for the dependencies to get resolved. 而且我看到jOOQ-codegen-maven项目有一个父级jooq-parent,因此您可能还需要构建该类以使依赖关系得到解决。

Once you have built and run jOOQ-codegen-maven and jooq-parent successfully, your local .m2 should have these dependencies, try building jooq-spring-example again and now the 3.10.0-SNAPSHOT dependencies should be resolved properly. 成功构建并运行jOOQ-codegen-maven和jooq-parent之后,您的本地.m2应该具有这些依赖关系,请再次尝试构建jooq-spring-example,现在应该可以正确解析3.10.0-SNAPSHOT依赖关系了。

The above should most likely fix the issue but in case if it doesn't work, you could possibly try using the version from central, https://mvnrepository.com/artifact/org.jooq/jooq-codegen-maven/3.9.5 and see if that helps build your spring example. 上面的代码最有可能解决问题,但是如果无法解决问题,您可以尝试使用中央版本的https://mvnrepository.com/artifact/org.jooq/jooq-codegen-maven/3.9。 5 ,看看这是否有助于构建您的春季示例。

There's no official release of 3.10.x jooq-codegen-maven plugin. 没有3.10.x jooq-codegen-maven插件的正式版本。

https://mvnrepository.com/artifact/org.jooq/jooq-codegen-maven https://mvnrepository.com/artifact/org.jooq/jooq-codegen-maven

You should try using any one of them found in the above link. 您应该尝试使用上面链接中找到的任何一个。

I believe that the code gen 3.10.0-SNAPSHOT has yet to be released, along with the rest of the 3.10.0-SNAPSHOT. 我认为代码生成器3.10.0-SNAPSHOT以及3.10.0-SNAPSHOT的其余部分都尚未发布。

If you need the functionality that has been developed and are comforatable using a library that has not been released yet, 如果您需要使用尚未发布的库开发的,可兼容的功能,

git clone https://github.com/jOOQ/jOOQ

then run 然后跑

mvn install

To build jooq 3.10.0-SNAPSHOT to your local repository. 要将jooq 3.10.0-SNAPSHOT构建到本地存储库。 The example should run on your local machine. 该示例应在本地计算机上运行。 Beware that it will not work elsewhere (EX: jenkins machine). 请注意,它将无法在其他地方使用(例如:詹金斯机器)。

If you do not feel comfortable using this unreleased code, use the latest published published published release version's example: 如果您不喜欢使用此未发布的代码,请使用最新发布的已发布发布版本的示例:

https://github.com/jOOQ/jOOQ/tree/version-3.9.0-branch/jOOQ-examples/jOOQ-spring-example https://github.com/jOOQ/jOOQ/tree/version-3.9.0-branch/jOOQ-examples/jOOQ-spring-example

As the dependency graph expects 3.10.0-SNAPSHOT. 正如依赖图期望的3.10.0-SNAPSHOT。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM