2016-06-12 181 views
1

試圖部署具有彈性的引導微服務項目服務發現模塊錯誤,同時啓動春季啓動尤里卡服務器

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.5.RELEASE: 
run (default-cli) on project serviceDiscovery: An exception occurred while running. null: 
InvocationTargetException: Unable to start embedded container; 
nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: 
Unable to start embedded Tomcat: Failed to start component [StandardServer[-1]]: 
Failed to start component [StandardService[Tomcat]]: 
Failed to start component [StandardEngine[Tomcat]]: 
A child container failed during start -> 

我已經發布了,我現在用 pom.xml中的http我收到以下錯誤://maven.apache.org/xsd/maven-4.0.0.xsd「> 4.0.0

<groupId>in.service</groupId> 
    <artifactId>serviceDiscovery</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <name>serviceDiscovery</name> 
    <description>Demo project for Spring Boot</description> 

    <parent> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-parent</artifactId> 
     <version>1.3.5.RELEASE</version> 
     <relativePath/> <!-- lookup parent from repository --> 
    </parent> 

    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <java.version>1.8</java.version> 
    </properties> 

    <dependencies> 
     <dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-starter-eureka-server</artifactId> 
      <version>1.1.0.RELEASE</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-test</artifactId> 
      <scope>test</scope> 
     </dependency> 
    </dependencies> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-maven-plugin</artifactId> 
      </plugin> 
     </plugins> 
    </build> 

    <repositories> 
     <repository> 
      <id>spring-snapshots</id> 
      <name>Spring Snapshots</name> 
      <url>https://repo.spring.io/snapshot</url> 
      <snapshots> 
       <enabled>true</enabled> 
      </snapshots> 
     </repository> 
     <repository> 
      <id>spring-milestones</id> 
      <name>Spring Milestones</name> 
      <url>https://repo.spring.io/milestone</url> 
      <snapshots> 
       <enabled>false</enabled> 
      </snapshots> 
     </repository> 
    </repositories> 


</project> 

的問題開始與彈簧引導起動父版本1.3.2.RELEASE。它開始給出以下錯誤

[ERROR]  Non-resolvable import POM: Failure to find 
org.springframework.cloud:spring-cloud-sleuth-dependencies:pom:1.0.2.BUILD-SNAPSHOT 
in https://repo.spring.io/snapshot was cached in the local repository, 
resolution will not be reattempted until the update interval of spring-snapshots 
has elapsed or updates are forced 
@ org.springframework.cloud:spring-cloud-dependencies:Brixton.BUILD-SNAPSHOT, 
/home/soumya/.m2/repository/org/springframework/cloud/spring-cloud-dependencies 
/Brixton.BUILD-SNAPSHOT/spring-cloud-dependencies-Brixton.BUILD-SNAPSHOT.pom 

我想增加彈簧引導父版本1.3.5,但它給了我另一套問題,因爲在一開始提供

回答

0

你可以使用Spring雲起動父母代替的春季啓動啓動父母。

<parent> 
    <groupId>org.springframework.cloud</groupId> 
    <artifactId>spring-cloud-starter-parent</artifactId> 
    <version>Brixton.RELEASE</version> 
    <relativePath/> <!-- lookup parent from repository --> 
</parent> 
+0

不,不工作 – Soumya

+0

不可分辨父POM:未能找到 \t org.springframework.boot:彈簧引導起動父:POM:Brixton.RELEASE在HTTP \t://repo.maven.apache .org/maven2被緩存在本地存儲庫中, \t分辨率將不會重新嘗試,直到中央的更新時間間隔結束 \t或更新被強制且'parent.relativePath'指向本地POM – Soumya

+0

它的spring-cloud-starter -parent,而不是spring-boot-starter-parent。您應該在groupId和artifactId中進行替換。 – techtabu

3

好的,這裏是解決方案。 保持父爲

<parent> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <version>1.3.5.RELEASE</version> 
    <relativePath /> 
    <!-- lookup parent from repository --> 
</parent> 

現在添加/修改下面的依賴管理

<dependencyManagement> 
    <dependencies> 
     <dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-dependencies</artifactId> 
      <version>Brixton.RELEASE</version> 
      <type>pom</type> 
      <scope>import</scope> 
     </dependency> 
    </dependencies> 
</dependencyManagement> 

彈簧引導啓動父(1.3.5和1.3.2)的兩個版本都在工作。 其實我在使用Brixton.BUILD-SNAPSHOT在我的依賴關係管理中,現在已經更改爲Brixton.RELEASE