我正在尝试构建官方JOOQ git repo here上给出的示例。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>
但是,由于<version>标记中的${org.jooq.version}变量,我无法对项目执行mvn compile操作,并得到以下输出。但是每当我看到这个插件插入的时候,我就会看到它是这样做的,甚至是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有人能帮我吗?干杯。
发布于 2017-09-18 10:46:50
这很可能是因为Maven在您的本地.m2中找不到jOOQ-codegen-maven 3.10.0-SNAPSHOT版本。我检查了你问题中的链接,我在这个链接https://github.com/jOOQ/jOOQ/blob/master/jOOQ-codegen-maven/pom.xml中看到了spring项目和它的依赖项目jOOQ-codegen-maven,所以导入这个并构建它,这样这个版本就可以进入你本地的.m2了。我看到jOOQ-codegen-maven项目有一个父jooq- parent,所以您可能也需要构建该父jooq-parent才能解决依赖关系。
一旦你成功地构建并运行了jOOQ-codegen-maven和jooq-parent,你的本地.m2就应该有这些依赖项了,再次尝试构建jooq-spring-example,现在3.10.0-SNAPSHOT的依赖项应该被正确地解决了。
上面的方法很可能会解决这个问题,但如果它不起作用,你可以尝试使用central,https://mvnrepository.com/artifact/org.jooq/jooq-codegen-maven/3.9.5的版本,看看这是否有助于构建你的spring示例。
发布于 2017-09-18 14:02:13
目前还没有正式发布3.10.x jooq-codegen-maven插件。
https://mvnrepository.com/artifact/org.jooq/jooq-codegen-maven
您应该尝试使用上述链接中的任何一个。
发布于 2017-09-28 03:20:01
我相信代码生成3.10.0-SNAPSHOT还没有发布,以及3.10.0-SNAPSHOT的其余部分。
如果您需要已经开发的功能,并且可以使用尚未发布的库,
git clone https://github.com/jOOQ/jOOQ
然后运行
mvn install将jooq 3.10.0-SNAPSHOT构建到本地存储库。该示例应在您的本地计算机上运行。注意,它不能在其他地方工作(例如: jenkins机器)。
如果您不习惯使用这个未发布的代码,请使用最新发布版本的示例:
https://github.com/jOOQ/jOOQ/tree/version-3.9.0-branch/jOOQ-examples/jOOQ-spring-example
因为依赖图期望3.10.0-SNAPSHOT。
https://stackoverflow.com/questions/46270535
复制相似问题