0

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>
Johnny
  • 7,073
  • 9
  • 46
  • 72
  • Can you post the rest of your pom? So if you clone the project. One of the modules is the dependency your talking about – Danielson Jun 24 '15 at 13:01

3 Answers3

3

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>
Johnny
  • 7,073
  • 9
  • 46
  • 72
2

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>
Tharik Kanaka
  • 2,490
  • 6
  • 31
  • 54
  • I think it's almost there. The only problem I now have is that when I run one of the samples I get an exception which doesn't happen when I add the Siddhi source to the project. `Exception in thread "main" java.lang.NoClassDefFoundError: org/antlr/v4/runtime/atn/ATNDeserializer at org.wso2.siddhi.query.compiler.SiddhiQLLexer.(SiddhiQLLexer.java:506) at org.wso2.siddhi.query.compiler.SiddhiCompiler.parse(SiddhiCompiler.java:52) ` – Johnny Jun 24 '15 at 21:14
  • For that error did you include antlr dependency? dependency> org.antlr antlr4-runtime 4.5 – Tharik Kanaka Jun 25 '15 at 05:52
  • I made a mistake. I'm actually getting a `Missing artifact org.wso2.siddhi:siddhi-core:jar:3.0.0-SNAPSHOT pom.xml` on all 3 dependencies. Looking into my .m2 directory I see the path `repository/org/wso2/wso2/1/` which contains .pom, .sha, .md5 and .repositories files but no jars. – Johnny Jun 25 '15 at 11:38
0

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... :-) )

Danielson
  • 2,605
  • 2
  • 28
  • 51
  • Is there no way to add the dependency without cloning the source? – Johnny Jun 24 '15 at 13:13
  • too old... http://maven-repository.com/search?q=siddhi ... Only really old (3 years) http://mvnrepository.com/search?q=siddhi – Danielson Jun 24 '15 at 13:22
  • Yep, definitely too old. This is v0.4 and they're up to 3.0 by now. – Johnny Jun 24 '15 at 13:38
  • If this project is really important to you, I could try to help you overcome the difficulties you are facing. Theoretically there is a 'chat' function here (don't know where) – Danielson Jun 24 '15 at 13:40