未找到gRPC Spring Boot Starter Maven

时间:2017-03-19 14:14:55

标签: java maven spring-mvc spring-boot grpc-java

我在Spring initilizr网站的帮助下创建了一个简单的maven spring boot 1.5.2.RELEASE应用程序,用spring boot app测试gRPC。正如任何人一样,我为gRPC循环使用spring boot starter以帮助配置复杂性。

    <dependency>
        <groupId>org.lognet</groupId>
        <artifactId>grpc-spring-boot-starter</artifactId>
        <version>2.0.0</version>
    </dependency>

问题是Maven似乎没有得到这种依赖。错误是Dependency '''org.lognet:grpc-spring-boot-starter:2.0.0''' not found

有没有简单的方法可以将gRPC与spring boot一起使用?

1 个答案:

答案 0 :(得分:0)

你必须像这样添加jcenter repo:

    function getPixelsOnLine(ctx, startX, startY, endX, endY){
        const imageData = ctx.getImageData(0,0,ctx.canvas.width,ctx.canvas.height);
        const data = imageData.data;
        const pixelCols = [];
        const getPixel = (x,y) => {
            if(x < 0 || x >= imageData.width || y < 0 || y >= imageData.height ){
                return "rgba(0,0,0,0)";
            }
            const ind = (x + y * imageData.width) * 4;
            return `rgba(${data[ind++]},${data[ind++]},${data[ind++]},${data[ind++]/255})`;
        }

        var x = Math.floor(startX);
        var y = Math.floor(startY);
        const xx = Math.floor(endX);
        const yy = Math.floor(endY);
        const dx = Math.abs(xx - x); 
        const sx = x < xx ? 1 : -1;
        const dy = -Math.abs(yy - y);
        const sy = y < yy ? 1 : -1;
        var err = dx + dy;
        var e2;
        var end = false;
        while (!end) {
            pixelCols.push(getpixel(x,y));
            if ((x === xx && y === yy)) {
                end = true;
            } else {
                e2 = 2 * err;
                if (e2 >= dy) {
                    err += dy;
                    x += sx;
                }
                if (e2 <= dx) {
                    err += dx;
                    y += sy;
                }
            }
        }
        return pixelCols;
    }