如何构建最新的 STORM 源​​代码以使用 core/external jar 作为应用程序开发 POM.xml 中使用的依赖项

how to build latest STORM source code to use core/external jars as dependencies used in application dev POM.xml

计划开发一个 Storm 应用程序以使用 kafka/mongodb,只有 github master 上的最新 STORM 支持 mongodb 的状态查询,所以我必须自己构建 STORM 才能使用它。成功构建 STORM 分发包。但我还需要构建在应用程序 POM.xml 中使用的 jar。我在 STORM 根项目中使用了 "mvn install",所有 STORM jar 都已成功构建并复制到我的本地 Maven 存储库。但是在构建应用程序时,可以在 POM 中解决依赖关系。但是dependencies中包含的那些jar的class/functions的所有符号都无法解析,所有下划线都是红色。

任何构建了最新 STORM 源​​代码的人都可以帮助我吗?

这些是我的关键部分 POM.xml:

    <groupId>com.fm.data</groupId>
    <artifactId>fmstreaming</artifactId>
    <version>1.0-SNAPSHOT</version>
    <properties>
        <storm.version>2.0.0-SNAPSHOT</storm.version>

        <storm.kafka.client.version>0.10.1.0</storm.kafka.client.version>
        <hbase.version>1.2.0</hbase.version>
        <mongodb.version>3.4.2</mongodb.version>

        <java.version>1.8</java.version>
        <java.encoding>UTF-8</java.encoding>

        <project-sourceEncoding>UTF-8</project-sourceEncoding>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.encoding>UTF-8</maven.compiler.encoding>

    </properties>

    <repositories>
        <repository>
            <id>nexus</id>
            <name>nexus</name>
            <url>http://pro-hbase01:8081/nexus/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>

    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.apache.storm</groupId>
            <artifactId>storm-core</artifactId>
            <version>${storm.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.storm</groupId>
            <artifactId>storm-kafka-client</artifactId>
            <version>${storm.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
            <version>${storm.kafka.client.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.storm</groupId>
            <artifactId>storm-mongodb</artifactId>
            <version>${storm.version}</version>
        </dependency>

    </dependencies>

    <build>
        <outputDirectory>target\classes</outputDirectory>
<!--
        <testOutputDirectory>target\test-classes</testOutputDirectory>
-->
        <testOutputDirectory>target\classes</testOutputDirectory>
        <resources>
            <resource>
                <directory>${project.basedir}/src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>

            <plugin>
                <groupId>org.codehaus.mojo </groupId>
                <artifactId>build-helper-maven-plugin </artifactId>
                <version>1.9.1 </version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <configuration>
                    <downloadSources>true</downloadSources>
                    <buildcommands>
                        <buildcommand>ch.epfl.lamp.sdt.core.scalabuilder</buildcommand>
                    </buildcommands>
                    <additionalProjectnatures>
                        <projectnature>ch.epfl.lamp.sdt.core.scalanature</projectnature>
                    </additionalProjectnatures>
                    <classpathContainers>
                        <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
                        <classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER</classpathContainer>
                    </classpathContainers>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.2</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                            <overWriteReleases>false</overWriteReleases>
                            <overWriteSnapshots>false</overWriteSnapshots>
                            <overWriteIfNewer>true</overWriteIfNewer>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <testFailureIgnore>true</testFailureIgnore>
                </configuration>
            </plugin>

        </plugins>
    </build>
    <reporting>
        <plugins>
        </plugins>
    </reporting>

如果您的本地 Maven 存储库包含 Storm jar(版本 2.0.0-SNAPSHOT),您的 pom 应该可以工作。也许在您的项目中从命令行 (mvn install) 尝试 运行 Maven。这将让您排除问题是与您的 POM 还是与某些 IntelliJ 设置有关。

同时考虑从您的 POM 中删除 Eclipse 插件,该插件已被弃用,您在 IntelliJ 或更新的 Eclipse 版本中确实不需要它。也许 IntelliJ 对 Eclipse 项目文件感到困惑?