小编m52*_*791的帖子

Zipkin 与 Spring Boot 2.2 和 Hoxton Cloud

我想将我的项目 Zipkin 设置更新为 Spring Boot 2.2.2.RELEASE 和 Spring Cloud Hoxton.RELEASE,但看起来简单的 jars 更新是不够的。

我认为旧的设置(它对 Spring Boot 2.1.5.RELEASE 和 Greenwich.SR2 工作正常)也适用于 Boot 2.2.2.RELEASE 和 Hoxton.RELEASE,但似乎我仍然错过了一些东西。

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.2.RELEASE</version>
        <relativePath/>
    </parent>

    <properties>
        ...
        <spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
<!--        <zipkin.version>2.12.9</zipkin.version> does not work either-->
        <zipkin.version>2.11.8</zipkin.version>
        ...  
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-zipkin</artifactId>
        </dependency>
        <dependency>
            <groupId>io.zipkin.java</groupId>
            <artifactId>zipkin-server</artifactId>
            <version>${zipkin.version}</version>
        </dependency>
        <dependency>
            <groupId>io.zipkin.java</groupId>
            <artifactId>zipkin-autoconfigure-ui</artifactId>
            <version>${zipkin.version}</version>
            <scope>runtime</scope>
        </dependency>
        ...
    </dependencies>

Run Code Online (Sandbox Code Playgroud)

我收到以下异常(java.lang.NoClassDefFoundError: zipkin2 /internal/Buffer$Writer):

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name …
Run Code Online (Sandbox Code Playgroud)

zipkin spring-boot spring-cloud

6
推荐指数
1
解决办法
775
查看次数

Spring Boot上的Jersey-ApplicationPath

有没有一种更编程的方式,等效于以下配置:

@ApplicationPath("api")
public class MyResourceConfig extends ResourceConfig {
Run Code Online (Sandbox Code Playgroud)

,为Jersey应用程序设置应用程序路径?我想使其可配置,并可能使用类似以下的内容:

property("jersey.config.<application.path>", api);
Run Code Online (Sandbox Code Playgroud)

与addtitinal:

@ConfigurationProperties(prefix = "jersey")
public class MyResourceConfig extends ResourceConfig {

@Setter @Getter protected String api;
Run Code Online (Sandbox Code Playgroud)

java spring jersey spring-boot

4
推荐指数
1
解决办法
3364
查看次数

Maven和spring-boot-dependencies

我有一个Maven多模块项目,它在主pom.xml中将一些旧版本的spring-boot-dependencies设置为parent.所有子模块都从此主pom.xml继承spring boot依赖项.

这很好但是在一个新的子模块(也是多模块)中我想使用最新的spring引导版本而不改变项目中正在使用的那个(连同所有依赖项).

有没有办法聪明地覆盖从父派生的弹簧引导版本(及其所有依赖项)并在子模块中使用不同的版本?我试图<spring-boot.version>在所有新模块的子模块的pom.xml文件中的属性中设置spring boot的显式版本,但没有运气.

maven spring-boot

3
推荐指数
1
解决办法
4473
查看次数

标签 统计

spring-boot ×3

java ×1

jersey ×1

maven ×1

spring ×1

spring-cloud ×1

zipkin ×1