2016-10-06 2 views
0

jar 파일을 더 큰 프로젝트의 일부로 빌드하려면 스프링 부트를 사용하고 싶습니다. 이는 이미 <parentID> 섹션을 정의했음을 의미합니다. 그리고 지금은 어떻게 든 내 프로젝트에 springboot를 연결해야 이것은 내가 생각 해낸 것입니다 :Maven with spring boot 사용 - parentID

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <parent> 
     <artifactId>spageeserver</artifactId> 
     <groupId>com.spagee</groupId> 
     <version>1.0-SNAPSHOT</version> 
    </parent> 

    <groupId>com.spagee</groupId> 
    <artifactId>persistence</artifactId> 
    <name>persistence</name> 
    <version>1.0-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <configuration> 
        <source>1.8</source> 
        <target>1.8</target> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 

    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 


    <dependencies> 
     <dependency> 
      <!-- Import dependency management from Spring Boot --> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-dependencies</artifactId> 
      <version>1.4.1.RELEASE</version> 
      <type>pom</type> 
      <scope>import</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-data-jpa</artifactId> 
      <version>1.4.1.RELEASE</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-jdbc</artifactId> 
      <version>1.4.1.RELEASE</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-web</artifactId> 
      <version>1.4.1.RELEASE</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-test</artifactId> 
      <version>1.4.1.RELEASE</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.h2database</groupId> 
      <artifactId>h2</artifactId> 
      <version>1.4.192</version> 
     </dependency> 
     <dependency> 
      <groupId>org.postgresql</groupId> 
      <artifactId>postgresql</artifactId> 
      <version>9.4.1208.jre7</version> 
     </dependency> 
    </dependencies> 
</project> 

하지만 프로젝트가 시작되지 않습니다 :

로 설정 "parentID"와 이전
2016-10-06 16:07:43.264[0;39m [32m INFO[0;39m [35m5296[0;39m [2m---[0;39m [2m[   main][0;39m [36mationConfigEmbeddedWebApplicationContext[0;39m [2m:[0;39m Closing org.springframework.boot[email protected]74fe5c40: startup date [Thu Oct 06 16:07:41 CEST 2016]; root of context hierarchy 
[2m2016-10-06 16:07:43.264[0;39m [33m WARN[0;39m [35m5296[0;39m [2m---[0;39m [2m[   main][0;39m [36mationConfigEmbeddedWebApplicationContext[0;39m [2m:[0;39m Exception thrown from LifecycleProcessor on context close 

java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.springframework.boot[email protected]74fe5c40: startup date [Thu Oct 06 16:07:41 CEST 2016]; root of context hierarchy 
    at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:415) [spring-context-4.2.8.RELEASE.jar:4.2.8.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:975) [spring-context-4.2.8.RELEASE.jar:4.2.8.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:934) [spring-context-4.2.8.RELEASE.jar:4.2.8.RELEASE] 
    at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:818) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:326) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
    at com.spagee.Runner.main(Runner.java:13) [classes/:na] 

봄 부츠도 괜찮 았어.는 그래서

홈페이지 POM

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>com.spagee</groupId> 
    <artifactId>spageeserver</artifactId> 
    <packaging>pom</packaging> 
    <version>1.0-SNAPSHOT</version> 
    <modules> 
     <module>facebookgrabber</module> 
     <module>persistence</module> 
    </modules> 


</project> 
+0

주요 모양은 무엇인가요? –

+0

이것은 도움이 될 수 있습니다 : [Maven 프로젝트가 여러 부모를 가질 수 있습니까?] (http://stackoverflow.com/questions/1636801/can-maven-projects-have-multiple-parents) –

답변

0

스프링 부트를 메인 메모리의 부모로 설정하십시오.

0

종속성 바로 아래 dependencyManagement에서 봄 부팅 의존성에 대한 의존성을 두는 대신 시도해보십시오 POM 수준의 문제를합니다.

관련 문제