'Package siddhi extensions in one jar

I am new to Siddhi, I originally used Eclipse for development and used "package required libraries into generated jar" to package all dependencies into one jar file, this way it worked fine.

But when I try to use intellij for development, and use maven to package all the dependencies into one jar file and run it, it comes up with ExtensionNotFoundException.

Exception in thread "pool-4-thread-1" io.siddhi.core.exception.ExtensionNotFoundException: Error on 'SiddhiApp' @ Line: 35. Position: 91, near '@sink(type='file',append = "true",file.uri = "alert.csv", @map(type='csv', header='false'))'. No extension exist for sink:file
    at io.siddhi.core.util.SiddhiClassLoader.loadExtensionImplementation(SiddhiClassLoader.java:46)
    at io.siddhi.core.util.parser.helper.DefinitionParserHelper.createSink(DefinitionParserHelper.java:840)
    at io.siddhi.core.util.parser.helper.DefinitionParserHelper.addEventSink(DefinitionParserHelper.java:488)
    at io.siddhi.core.util.SiddhiAppRuntimeBuilder.defineStream(SiddhiAppRuntimeBuilder.java:119)
    at io.siddhi.core.util.parser.SiddhiAppParser.defineStreamDefinitions(SiddhiAppParser.java:375)
    at io.siddhi.core.util.parser.SiddhiAppParser.parse(SiddhiAppParser.java:231)
    at io.siddhi.core.SiddhiManager.createSiddhiAppRuntime(SiddhiManager.java:87)
    at io.siddhi.core.SiddhiManager.createSiddhiAppRuntime(SiddhiManager.java:97)
    at com.iocontrols.example.module.siddhi.SiddhiService.run(SiddhiService.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

pom.xml

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.3.0</version>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>com.example.Main</mainClass>
                    </manifest>
                </archive>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
            <executions>
                <execution>
                    <id>make-jar</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source