如何在 Google Cloud 数据流管道项目 pom 中使用 beam-sdks-java-core-2.2.0.j



我最近使用Google Java eclipse插件建立了一个Google Cloud数据流管道项目。默认的 SKD 版本是 pom 中的 2.1.0。

<dependencies>
<dependency>
  <groupId>com.google.cloud.dataflow</groupId>
  <artifactId>google-cloud-dataflow-java-sdk-all</artifactId>
  <version>2.1.0</version>
</dependency>
... ...

代码可以部署,但在将数据插入大查询时NullPointerException异常。然后我找到了以下文章,它说该问题已在 2.2.0 版中修复,https://issues.apache.org/jira/browse/BEAM-2834。

但我不知道该怎么做。我将pom版本从2.1.0更改为2.2.0,所有依赖项都消失了,错误Missing artifact com.google.cloud.dataflow:google-cloud-dataflow-java-sdk-all:jar:2.2.0google-cloud-dataflow-java-sdk-all-2.1.0.jarbeam-sdks-java-core-2.1.0.jar的版本相同。我不仅可以beam-sdks-java-core-2.1.0.jar版本更改为2.2.0

如果有人可以向我展示有关如何更新jar版本或如何修复NullPointerException异常的示例,那将对我有很大帮助。

提前非常感谢。

====

================================================

这是我的绒球

<?xml version="1.0" encoding="UTF-8"?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~ Copyright (C) 2017 Google Inc.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License"); you may not
  ~ use this file except in compliance with the License. You may obtain a copy of
  ~ the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  ~ License for the specific language governing permissions and limitations under
  ~ the License.
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<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.company.product</groupId>
  <artifactId>my-product</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <repositories>
    <repository>
      <id>ossrh.snapshots</id>
      <name>Sonatype OSS Repository Hosting</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
  <build>
   <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.6.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>1.5.0</version>
          <configuration>
            <cleanupDaemonThreads>false</cleanupDaemonThreads>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  <dependencies>
    <dependency>
      <groupId>com.google.cloud.dataflow</groupId>
      <artifactId>google-cloud-dataflow-java-sdk-all</artifactId>
      <version>2.1.0</version>
    </dependency>
    <!-- slf4j API frontend binding with JUL backend -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.14</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <version>1.7.14</version>
    </dependency>
  </dependencies>
</project>
2.2.0 尚未

从 Maven 获得,即 Google 尚未从头部/主中删除并制作了新的2.2.0构建。AFAIK,目前正在进行中。

https://github.com/GoogleCloudPlatform/DataflowJavaSDK/releaseshttps://mvnrepository.com/artifact/com.google.cloud.dataflow/google-cloud-dataflow-java-sdk-all

如果需要,您可以下载最新版本并自己构建/使用它 - 如果您等不及2.2.0版本。

相关内容

最新更新