2017-09-18 3 views
0

공식 JOOQ git repo here에있는 예제를 작성하려고합니다. 메이븐 pom.xml 파일 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>

나는 mvn compile, 프로젝트 관리 아니에요, 나는 때문에 ${org.jooq.version} 변수의 다음과 같은 출력을 얻고있다 그러나 <version> 태그 하지만이 플러그인을 삽입 할 때마다이 방법으로 보았습니다. 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 

아무도 도와 줄 수 있습니까? 건배.

답변

2

Maven cant가 로컬 .m2에서 jOOQ-codegen-maven 3.10.0-SNAPSHOT 버전을 찾을 가능성이 높습니다. 귀하의 질문에서 링크를 확인하고 스프링 프로젝트와 그 종속 프로젝트 인 jOOQ-codegen-maven이이 링크 https://github.com/jOOQ/jOOQ/blob/master/jOOQ-codegen-maven/pom.xml에 있으므로이 파일을 가져 와서 빌드하면이 버전이 로컬 .m2에 들어갑니다. 그리고 jOOQ-codegen-maven 프로젝트에는 부모 인 jooq-parent가 있으므로, 의존성을 해결하기 위해 빌드해야 할 수도 있습니다.

jOOQ-codegen-maven 및 jooq-parent를 성공적으로 빌드하고 실행 한 경우 로컬 .m2에 이러한 종속성이 있어야하며 jooq-spring-example을 다시 빌드하고 3.10.0-SNAPSHOT 종속성을 해결해야합니다. 정확히.

위의 내용은 대부분이 문제를 해결할 수 있지만 작동하지 않을 경우 https://mvnrepository.com/artifact/org.jooq/jooq-codegen-maven/3.9.5의 버전을 사용하여 스프링 예제를 만드는 데 도움이되는지 확인해 볼 수 있습니다.

0

3.10.0-SNAPSHOT의 나머지 부분과 함께 3.10.0-SNAPSHOT 코드가 아직 릴리스되지 않았다고 믿습니다. 당신이 개발하고 아직 발표되지 않은 라이브러리를 사용하여 comforatable 있습니다 된 기능,

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

필요한 경우

다음

mvn install 

이 jooq 3.10.0를 구축하기 위해 실행 -SNAPSHOT을 로컬 저장소에 저장하십시오. 예제는 로컬 시스템에서 실행해야합니다. 다른 곳에서는 작동하지 않습니다 (EX : jenkins machine). 종속성 그래프 3.10.0 스냅 샷을 기대로

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

:

이 출시되지 않은 코드를 사용하여 편안하지 않으면

는 최신 출판 출판 출판 릴리스 버전의 예제를 사용합니다.