Skip to content

Conversation

@azusa
Copy link

@azusa azusa commented Dec 24, 2014

query-dsl-maven-plugin
がmavenのライフサイクルにぶら下がっていないため、明示的に mvn
querydsl:exportを叩かないとコード生成されるタイミングがないように見えます。(実際Eclipseに取り込んだ時に生成されなかった)

querydsl-sample-dbでmvn clean
installした時にコード生成されるよう、querydsl-maven-pluginをprocess-resourcesフェーズにぶらさげました。

@azusa azusa changed the title Enaable source generate when execute "mvn install" Enable source generate when execute "mvn install" Dec 24, 2014
query-dsl-maven-plugin
がmavenのライフサイクルにぶら下がっていないため、明示的に mvn
querydsl:exportを叩かないとコード生成されるタイミングがないように見えます。(実際Eclipseに取り込んだ時に生成されなかった)

querydsl-sample-dbでmvn clean
installした時にコード生成されるよう、querydsl-maven-pluginをprocess-resourcesフェーズにぶらさげました。
@nabedge
Copy link
Owner

nabedge commented Dec 24, 2014

mvn clean install したら、中に*.classが一つもないjarファイルができてしまいました。
(いまちょっと時間取れないので、週末にでも調べさせてください。)

nabedge-no-MacBook-Air:tmp nabedge$ git clone https://github.com/azusa/querydsl-sample.git
Cloning into 'querydsl-sample'...
remote: Counting objects: 117, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 117 (delta 0), reused 1 (delta 0)
Receiving objects: 100% (117/117), 16.37 KiB | 0 bytes/s, done.
Resolving deltas: 100% (35/35), done.
Checking connectivity... done.
nabedge-no-MacBook-Air:tmp nabedge$ cd querydsl-sample/querydsl-sample-db/
nabedge-no-MacBook-Air:querydsl-sample-db nabedge$ mvn clean install
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building querydsl-sample-db 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ querydsl-sample-db ---
[INFO] 
[INFO] --- querydsl-maven-plugin:3.4.3:export (default) @ querydsl-sample-db ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ querydsl-sample-db ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- sql-maven-plugin:1.5:execute (create-tables) @ querydsl-sample-db ---
[INFO] Executing file: /Users/nabedge/tmp/querydsl-sample/querydsl-sample-db/src/main/resources/sql/00_init.sql
[INFO] 11 of 11 SQL statements executed successfully
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ querydsl-sample-db ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ querydsl-sample-db ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/nabedge/tmp/querydsl-sample/querydsl-sample-db/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ querydsl-sample-db ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ querydsl-sample-db ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ querydsl-sample-db ---
[INFO] Building jar: /Users/nabedge/tmp/querydsl-sample/querydsl-sample-db/target/querydsl-sample-db-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ querydsl-sample-db ---
[INFO] Installing /Users/nabedge/tmp/querydsl-sample/querydsl-sample-db/target/querydsl-sample-db-1.0-SNAPSHOT.jar to /Users/nabedge/.m2/repository/com/example/querydsl-sample/querydsl-sample-db/1.0-SNAPSHOT/querydsl-sample-db-1.0-SNAPSHOT.jar
[INFO] Installing /Users/nabedge/tmp/querydsl-sample/querydsl-sample-db/pom.xml to /Users/nabedge/.m2/repository/com/example/querydsl-sample/querydsl-sample-db/1.0-SNAPSHOT/querydsl-sample-db-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.899 s
[INFO] Finished at: 2014-12-24T23:42:00+09:00
[INFO] Final Memory: 13M/168M
[INFO] ------------------------------------------------------------------------
nabedge-no-MacBook-Air:querydsl-sample-db nabedge$ jar -tf target/querydsl-sample-db-1.0-SNAPSHOT.jar 
META-INF/
META-INF/MANIFEST.MF
sql/
.gitkeep
sql/00_init.sql
META-INF/maven/
META-INF/maven/com.example.querydsl-sample/
META-INF/maven/com.example.querydsl-sample/querydsl-sample-db/
META-INF/maven/com.example.querydsl-sample/querydsl-sample-db/pom.xml
META-INF/maven/com.example.querydsl-sample/querydsl-sample-db/pom.properties

mavenのバージョンの問題?。。。ではなさそう、ですね。

nabedge-no-MacBook-Air:querydsl-sample-db nabedge$ mvn -version
Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T22:51:42+09:00)
Maven home: /Users/nabedge/tool/apache-maven-3.2.2
Java version: 1.8.0_25, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre
Default locale: ja_JP, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.5", arch: "x86_64", family: "mac"

@azusa
Copy link
Author

azusa commented Dec 25, 2014

master ブランチにいるみたいなので、enable_source_generate_when_mvn_install ブランチをチェックアウトしてください。

@nabedge
Copy link
Owner

nabedge commented Dec 25, 2014

ありがとうございます。寝ボケた状態でやるもんじゃないっすね。^^;)あらためて週末に拝見します。

nabedge added a commit that referenced this pull request Dec 27, 2014
Enable source generate when execute "mvn install"
Thank you azusa!
@nabedge nabedge merged commit fd56961 into nabedge:master Dec 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants