Petersoj / alpaca-java

A Java API for Alpaca, the commission free, algo friendly, stock trading broker. https://alpaca.markets
https://petersoj.github.io/alpaca-java/
MIT License
197 stars 82 forks source link

java.lang.NoClassDefFoundError: AlpacaWebsocketClient on mvn exec:java #6

Closed Petersoj closed 5 years ago

Petersoj commented 5 years ago

My pom.xml is simply:

        <dependency>
            <groupId>io.github.mainstringargs</groupId>
            <artifactId>alpaca-java</artifactId>
            <version>2.0</version>
            <scope>compile</scope>
        </dependency>

I have checked the jar in my local maven repository and it does contain all the generated classes. I've tested the sample code on version 1.1 and it works great. I might be completely missing something on my end, but I've reinstalled all dependencies from the latest version from maven central and still get this error.

Also, is there an ETA for the PolygonAPI to be released on Maven Central?

mainstringargs commented 5 years ago

Looks to be an issue with a camel cased package name. I've just pushed 3.0 which fixes that and includes the Polygon API. Please give it a try and let me know if you have better luck.

Just to make sure we're on the same page, I tested it with this simple pom.xml and it looks to be working correctly:

<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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>test-project</groupId>
    <artifactId>test-alpaca-project</artifactId>
    <version>1.0</version>
    <dependencies>
        <dependency>
            <groupId>io.github.mainstringargs</groupId>
            <artifactId>alpaca-java</artifactId>
            <version>3.0.0</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
</project>
Petersoj commented 5 years ago

Thanks!