如何在我的pom.xml文件中添加对Siddhi CEP的依赖?

时间:2015-06-24 12:57:27

标签: java maven siddhi

有谁知道如何在最新版本的Siddhi CEP上添加依赖关系(最好不要克隆源代码)?我试过(来自Github repo):

<dependency>
    <groupId>org.wso2.siddhi</groupId>
    <artifactId>siddhi</artifactId>
    <version>3.0.0-SNAPSHOT</version>
</dependency>

但我错过了依赖错误。很确定这是因为我对Maven知之甚少,但到目前为止我还没弄清楚这一点。

更新 - 根据要求提供。所有的pom.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<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">
    <parent>
        <artifactId>examples</artifactId>
        <groupId>eu.ferari</groupId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>examples.distributedcount</artifactId>
    <build>
    <plugins>
    <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <mainClass>eu.ferari.examples.distributedcount.misc.Coordinator</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons.version}</version>
        </dependency>    
        <dependency>
            <groupId>com.espertech</groupId>
            <artifactId>esper</artifactId>
            <version>${esper.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>${jedis.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${log4j.version}</version>
        </dependency>    
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>${hamcrest.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>${mockito.version}</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>eu.ferari</groupId>
            <artifactId>ferari-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.storm</groupId>
            <artifactId>storm-core</artifactId>
            <version>${storm.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>slf4j-api</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>log4j-over-slf4j</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>logback-classic</artifactId>
                    <groupId>ch.qos.logback</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.siddhi</groupId>
            <artifactId>siddhi-core</artifactId>
            <version>0.4.0</version>
        </dependency>
    </dependencies>
</project>

3 个答案:

答案 0 :(得分:3)

最后偶然发现了答案。首先,您需要向您添加pom.xml文件:

<repositories>
    <repository>
        <id>WSO2</id>
        <url>http://maven.wso2.org/nexus/content/repositories/releases/</url>
    </repository>
</repositories>

然后添加以下依赖项:

<dependency>
    <groupId>org.wso2.siddhi</groupId>
    <artifactId>siddhi-core</artifactId>
    <version>3.0.0-M1</version>
</dependency>
<dependency>
    <groupId>org.wso2.siddhi</groupId>
    <artifactId>siddhi-query-api</artifactId>
    <version>3.0.0-M1</version>
</dependency>
<dependency>
    <groupId>org.wso2.siddhi</groupId>
    <artifactId>siddhi-query-compiler</artifactId>
    <version>3.0.0-M1</version>
</dependency>
<dependency>
    <groupId>org.antlr</groupId>
    <artifactId>antlr4-runtime</artifactId>
    <version>4.5</version>
</dependency>

答案 1 :(得分:2)

请包含以下3个依赖项并尝试

<dependency>
    <groupId>org.wso2.siddhi</groupId>
    <artifactId>siddhi-core</artifactId>
    <version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
    <groupId>org.wso2.siddhi</groupId>
    <artifactId>siddhi-query-api</artifactId>
    <version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
    <groupId>org.wso2.siddhi</groupId>
    <artifactId>siddhi-query-compiler</artifactId>
    <version>3.0.0-SNAPSHOT</version>
</dependency>

答案 2 :(得分:0)

我不确定你已经做了什么,但是。 (假设你已经安装了Git) 打开Cmd

{{1}}

打开Eclipse(假设更多)

还有m2e(Maven 2 Eclipse作为插件)

然后导入Maven项目,指向主目录。这将导入所有子包...

您所指的依赖项是项目的主要内容......

我希望我很清楚...很难猜出你拥有什么并与之合作

(顺便说一句,我知道开始使用GIT和Maven可能会很痛苦,但后来...... :-))