【问题标题】:correct way to create twitter heron project using intellij使用 intellij 创建 twitter heron 项目的正确方法
【发布时间】:2016-06-01 14:54:11
【问题描述】:

我正在尝试使用 IntelliJ IDEA 启动一个苍鹭项目(或移植现有的风暴项目),但不幸的是我无法让它工作。

我已经测试了 Heron Docsupgrade from storm 中的所有建议指令,但是在根据文档更改 POM.xml 文件后,我在使用 maven 编译和添加库罐子时从基本的苍鹭类和方法中得到了一堆 cannot find symbol没有帮助(就像以前暴风雨一样)。

我也尝试使用setup-intellij.sh 脚本制作一个 intellij 项目,但不幸的是它因错误而停止:

null failed: _pex failed: error executing command
bazel-out/local_linux-fastbuild/bin/3rdparty/pex/_pex --entry-point heron.shell.src.python.main bazel-out/local_linux-fastbuild/bin/heron/shell/src/python/heron-shell.pex ...
(remaining 1 argument(s) skipped)

我想知道使用 intelliJ IDEA 创建工作项目的最简单方法是什么。

我必须将风暴库和苍鹭库添加到 intelliJ 吗?如何附加所需的库以便正确编译?

任何建议都将不胜感激。

【问题讨论】:

    标签: java maven intellij-idea apache-storm heron


    【解决方案1】:

    使用backtype.storm.* 而不是com.twitter.heron.api.* 来导入类。 这些包都存在于苍鹭库中。 只需要添加如下依赖即可:

        <dependency>
            <groupId>com.twitter.heron</groupId>
            <artifactId>heron-storm</artifactId>
            <version>0.14.0</version>
        </dependency>
    

    【讨论】:

      【解决方案2】:

      IntellJ 中有一个 Heron 项目正在运行,here
      pom.xml 内容为:

      <groupId>io.streaml.heron.streamlet</groupId>
          <artifactId>heron-java-streamlet-api-example</artifactId>
          <version>latest</version>
      
          <properties>
              <maven.compiler.source>1.8</maven.compiler.source>
              <maven.compiler.target>1.8</maven.compiler.target>
              <heron.version>0.17.2</heron.version>
          </properties>
      
          <dependencies>
              <dependency>
                  <groupId>com.twitter.heron</groupId>
                  <artifactId>heron-api</artifactId>
                  <version>${heron.version}</version>
              </dependency>
          </dependencies>
      
          <build>
              <plugins>
                  <plugin>
                      <artifactId>maven-assembly-plugin</artifactId>
                      <configuration>
                          <descriptorRefs>
                              <descriptorRef>jar-with-dependencies</descriptorRef>
                          </descriptorRefs>
                          <archive>
                              <manifest>
                                  <mainClass></mainClass>
                              </manifest>
                          </archive>
                      </configuration>
                      <executions>
                          <execution>
                              <id>make-assembly</id>
                              <phase>package</phase>
                              <goals>
                                  <goal>single</goal>
                              </goals>
                          </execution>
                      </executions>
                  </plugin>
             </plugins>
          </build>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-12-12
        • 1970-01-01
        • 1970-01-01
        • 2012-08-18
        • 2019-11-23
        • 1970-01-01
        相关资源
        最近更新 更多