JHipster新项目无法运行

时间:2018-04-27 13:24:20

标签: java spring spring-boot jhipster

我使用Windows 10,我使用JHipster创建一个新项目,我可以运行“npm start”或使用yarn。但是后端会出错。

我用: JHipster v4.14.3 Npm v6.0.0 java v1.8.0_72 Apache Maven 3.5.3

创建项目后,我运行“mvn clean install -Dmaven.test.skip = true”。 这是运行命令时的错误:mvnw

[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building Test 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) > test-compile @ test >>>
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:copy-resources (default-resources) @ test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 14 resources
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 14 resources
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-versions) @ test ---
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:copy-resources (docker-resources) @ test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- jacoco-maven-plugin:0.7.9:prepare-agent (pre-unit-tests) @ test ---
[INFO] argLine set to -javaagent:C:\\Users\\user\\.m2\\repository\\org\\jacoco\\org.jacoco.agent\\0.7.9\\org.jacoco.agent-0.7.9-runtime.jar=destfile=c:\\dev\\projets\\test\\target\\test-results\\coverage\\jacoco\\jacoco.exec -Djava.security.egd=file:/dev/./urandom -Xmx256m
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ test ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 75 source files to c:\dev\projets\test\target\classes
[ERROR] error reading C:\Users\user\.m2\repository\org\springframework\security\spring-security-core\4.2.5.RELEASE\spring-security-core-4.2.5.RELEASE.jar; invalid LOC header (bad signature)
[ERROR] error reading C:\Users\user\.m2\repository\org\thymeleaf\thymeleaf\2.1.6.RELEASE\thymeleaf-2.1.6.RELEASE.jar; invalid LOC header (bad signature)
[ERROR] error reading C:\Users\user\.m2\repository\ognl\ognl\3.0.8\ognl-3.0.8.jar; invalid LOC header (bad signature)
[ERROR] error reading C:\Users\user\.m2\repository\org\springframework\spring-web\4.3.16.RELEASE\spring-web-4.3.16.RELEASE.jar; invalid CEN header (bad signature)
[ERROR] error reading C:\Users\user\.m2\repository\org\springframework\spring-webmvc\4.3.16.RELEASE\spring-webmvc-4.3.16.RELEASE.jar; invalid LOC header (bad signature)
[ERROR] error reading C:\Users\user\.m2\repository\org\springframework\cloud\spring-cloud-spring-service-connector\1.2.5.RELEASE\spring-cloud-spring-service-connector-1.2.5.RELEASE.jar; invalid LOC header (bad signature)
[ERROR] error reading C:\Users\user\.m2\repository\org\springframework\cloud\spring-cloud-core\1.2.5.RELEASE\spring-cloud-core-1.2.5.RELEASE.jar; invalid LOC header (bad signature)
[ERROR] error reading C:\Users\user\.m2\repository\org\springframework\data\spring-data-commons\1.13.11.RELEASE\spring-data-commons-1.13.11.RELEASE.jar; invalid LOC header (bad signature)
[ERROR] error reading C:\Users\user\.m2\repository\io\undertow\undertow-core\1.4.23.Final\undertow-core-1.4.23.Final.jar; invalid LOC header (bad signature)
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ test ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] <<< spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) < test-compile @ test <<<
[INFO] 
[INFO] 
[INFO] --- spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) @ test ---
[INFO] Attaching agents: []
The Class-Path manifest attribute in C:\Users\user\.m2\repository\org\liquibase\liquibase-core\3.5.5\liquibase-core-3.5.5.jar referenced one or more files that do not exist: file:/C:/Users/user/.m2/repository/org/liquibase/liquibase-core/3.5.5/lib/snakeyaml-1.13.jar
Exception in thread "main" java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of jar file:/C:/Users/user/.m2/repository/org/springframework/security/spring-security-core/4.2.5.RELEASE/spring-security-core-4.2.5.RELEASE.jar
    at org.springframework.boot.devtools.restart.ChangeableUrls.getUrlsFromClassPathOfJarManifestIfPossible(ChangeableUrls.java:110)
    at org.springframework.boot.devtools.restart.ChangeableUrls.fromUrlClassLoader(ChangeableUrls.java:96)
    at org.springframework.boot.devtools.restart.DefaultRestartInitializer.getUrls(DefaultRestartInitializer.java:93)
    at org.springframework.boot.devtools.restart.DefaultRestartInitializer.getInitialUrls(DefaultRestartInitializer.java:56)
    at org.springframework.boot.devtools.restart.Restarter.<init>(Restarter.java:140)
    at org.springframework.boot.devtools.restart.Restarter.initialize(Restarter.java:583)
    at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationStartingEvent(RestartApplicationListener.java:67)
    at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationEvent(RestartApplicationListener.java:45)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
    at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:69)
    at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:48)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:292)
    at com.mycompany.myapp.TestApp.main(TestApp.java:66)
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
    at java.util.zip.ZipFile.read(Native Method)
    at java.util.zip.ZipFile.access$1400(ZipFile.java:60)
    at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:734)
    at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:434)
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
    at sun.misc.IOUtils.readFully(IOUtils.java:65)
    at java.util.jar.JarFile.getBytes(JarFile.java:425)
    at java.util.jar.JarFile.getManifestFromReference(JarFile.java:193)
    at java.util.jar.JarFile.getManifest(JarFile.java:180)
    at org.springframework.boot.devtools.restart.ChangeableUrls.getUrlsFromManifestClassPathAttribute(ChangeableUrls.java:131)
    at org.springframework.boot.devtools.restart.ChangeableUrls.getUrlsFromClassPathOfJarManifestIfPossible(ChangeableUrls.java:107)
    ... 15 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.420 s
[INFO] Finished at: 2018-04-27T14:17:50+02:00
[INFO] Final Memory: 47M/474M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) on project test: Could not exec java: Application finished with exit code: 1 -> [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/MojoExecutionException

但是github上的这个项目效果很好:

https://github.com/jhipster/jhipster-sample-app

谢谢你

0 个答案:

没有答案