包x.x.x.repository.search没有成功生成。我可以解决它。
源代码为here
我只是运行npm install -g generator-jhipster-elasticsearch-reindexer.it return"无法编写模块生成器-jhipster-elasticsearch-reindexer"。当我运行时./mvnw它显示了一些存储库.search包确实存在。
➜ blog npm install -g generator-jhipster-elasticsearch-reindexer
/Users/qk/.nvm/versions/node/v7.7.4/lib
└─┬ generator-jhipster-elasticsearch-reindexer@1.0.1
└─┬ generator-jhipster@4.7.0
└─┬ yeoman-environment@2.0.2
└─┬ inquirer@3.2.3
└─┬ external-editor@2.0.4
└── iconv-lite@0.4.19
➜ blog git:(master) jhipster import-jdl /Users/qk/myosgit/blog/src/main/resources/dsl/equipment-jdl.jh
Executing jhipster:import-jdl /Users/qk/myosgit/blog/src/main/resources/dsl/equipment-jdl.jh
The jdl is being parsed.
Writing entity JSON files.
Generating entities.
Found the .jhipster/MxpmsSearchEquipment.json configuration file, entity can be automatically generated!
The entity MxpmsSearchEquipment is being updated.
identical src/main/resources/config/liquibase/changelog/20170910070621_added_entity_MxpmsSearchEquipment.xml
identical src/main/java/com/sgcc/pms/domain/MxpmsSearchEquipment.java
identical src/main/java/com/sgcc/pms/repository/MxpmsSearchEquipmentRepository.java
identical src/main/java/com/sgcc/pms/web/rest/MxpmsSearchEquipmentResource.java
identical src/main/java/com/sgcc/pms/service/dto/MxpmsSearchEquipmentDTO.java
identical src/main/java/com/sgcc/pms/service/mapper/EntityMapper.java
identical src/main/java/com/sgcc/pms/service/mapper/MxpmsSearchEquipmentMapper.java
identical src/test/java/com/sgcc/pms/web/rest/MxpmsSearchEquipmentResourceIntTest.java
identical src/main/resources/config/liquibase/master.xml
Running post run module hooks
Could not compose module generator-jhipster-elasticsearch-reindexer.
Make sure you have installed the module with 'npm -g generator-jhipster-elasticsearch-reindexer'
Execution complete
the source code is here
➜ blog git:(master) ✗ ./mvnw
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Blog 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.5.6.RELEASE:run (default-cli) > test-compile @ blog >>>
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:copy-resources (default-resources) @ blog ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 7 resources
[INFO] Copying 7 resources
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ blog ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 7 resources
[INFO] Copying 7 resources
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-versions) @ blog ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.9:prepare-agent (pre-unit-tests) @ blog ---
[INFO] argLine set to -javaagent:/Users/qk/.m2/repository/org/jacoco/org.jacoco.agent/0.7.9/org.jacoco.agent-0.7.9-runtime.jar=destfile=/Users/qk/myosgit/blog/target/test-results/coverage/jacoco/jacoco.exec -Djava.security.egd=file:/dev/./urandom -Xmx256m
[INFO]
[INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ blog ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 54 source files to /Users/qk/myosgit/blog/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[6,1] 程序包com.sgcc.pms.repository.search不存在
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[7,33] 程序包org.elasticsearch.indices不存在
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[10,51] 程序包org.springframework.data.elasticsearch.core不存在
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[11,57] 程序包org.springframework.data.elasticsearch.repository不存在
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[28,19] 找不到符号
符号: 类 MxpmsSearchEquipmentSearchRepository
位置: 类 com.sgcc.pms.service.ElasticsearchIndexService
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[30,19] 找不到符号
符号: 类 ElasticsearchTemplate
位置: 类 com.sgcc.pms.service.ElasticsearchIndexService
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[34,9] 找不到符号
符号: 类 MxpmsSearchEquipmentSearchRepository
位置: 类 com.sgcc.pms.service.ElasticsearchIndexService
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[35,9] 找不到符号
符号: 类 ElasticsearchTemplate
位置: 类 com.sgcc.pms.service.ElasticsearchIndexService
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[52,63] 找不到符号
符号: 类 ElasticsearchRepository
位置: 类 com.sgcc.pms.service.ElasticsearchIndexService
[INFO] 9 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.357 s
[INFO] Finished at: 2017-09-10T16:20:33+08:00
[INFO] Final Memory: 53M/535M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on project blog: Compilation failure: Compilation failure:
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[6,1] 程序包com.sgcc.pms.repository.search不存在
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[7,33] 程序包org.elasticsearch.indices不存在
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[10,51] 程序包org.springframework.data.elasticsearch.core不存在
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[11,57] 程序包org.springframework.data.elasticsearch.repository不存在
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[28,19] 找不到符号
[ERROR] 符号: 类 MxpmsSearchEquipmentSearchRepository
[ERROR] 位置: 类 com.sgcc.pms.service.ElasticsearchIndexService
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[30,19] 找不到符号
[ERROR] 符号: 类 ElasticsearchTemplate
[ERROR] 位置: 类 com.sgcc.pms.service.ElasticsearchIndexService
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[34,9] 找不到符号
[ERROR] 符号: 类 MxpmsSearchEquipmentSearchRepository
[ERROR] 位置: 类 com.sgcc.pms.service.ElasticsearchIndexService
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[35,9] 找不到符号
[ERROR] 符号: 类 ElasticsearchTemplate
[ERROR] 位置: 类 com.sgcc.pms.service.ElasticsearchIndexService
[ERROR] /Users/qk/myosgit/blog/src/main/java/com/sgcc/pms/service/ElasticsearchIndexService.java:[52,63] 找不到符号
[ERROR] 符号: 类 ElasticsearchRepository
[ERROR] 位置: 类 com.sgcc.pms.service.ElasticsearchIndexService
[ERROR] -> [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/MojoFailureException
答案 0 :(得分:3)
您的项目.yo-rc.json
不使用elasticsearch:"searchEngine": false,
。
将其替换为"searchEngine": "elasticsearch",
并使用jhipster --with-entities
重新生成,然后重新安装索引器模块。
作为旁注,we recommend using an LTS version of Node(目前为6.x),您使用的是7.7.4。
编辑:
你的项目使用纱线,与npm混合通常是一个坏主意,所以不要使用:
npm install -g generator-jhipster-elasticsearch-reindexer
你应该使用:
yarn global add generator-jhipster-elasticsearch-reindexer
无论如何,我重现了你的错误,所以这似乎是一个错误。请在https://github.com/geraldhumphries/generator-jhipster-elasticsearch-reindexer/issues/32
向模块作者报告