How can I add a dependency on Siddhi CEP to my pom.xml file?

883 views Asked by At

Does anyone know how to add a dependency on the latest version of Siddhi CEP (preferably without cloning the source)? I tried (from the Github repo):

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

But I get a missing dependency error. Pretty sure this is because I don't know enough about Maven, but I haven't been able to figure this out so far.

Update - as requested. all of the pom.xml file:

<?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

There are 3 answers

0
Johnny On BEST ANSWER

Finally stumbled on the answer. First you need to add to you pom.xml file:

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

Then add the following dependencies:

<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>
4
Danielson On

I'm not sure what you've done already, but. (Assuming you've got Git installed) Open Cmd

git clone https://github.com/wso2/siddhi.git

Open Eclipse (assuming more)

Also have m2e (Maven 2 Eclipse as plugin)

then import Maven project, point to the main directory. This will import all of the subpackages as well...

The dependency you are referring to is the main pom op that project...

I hope I'm clear... It's hard to guess what you have and work with

(btw, I know it can be a pain to start working with GIT and Maven,,, but later... :-) )

3
Tharik Kanaka On

Please include following 3 dependencies and try

<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>