How to add android library Volley to a plain maven project

Viewed 466

I would like to try the Volley library on my plain maven project with java 8 or 11. I am however not able to add this dependency properly. It is an android library by google. So I am not using android studio, but just Intellij IDEA with maven.

When I add it as:

<dependency>
    <groupId>com.android.volley</groupId>
    <artifactId>volley</artifactId>
    <version>1.1.1</version>
</dependency>

I am getting: Cannot resolve com.android.volley:volley:1.1.1

When I include the type pom as instructed here: https://bintray.com/android/android-utils/com.android.volley.volley/1.1.1#

<dependency>
    <groupId>com.android.volley</groupId>
    <artifactId>volley</artifactId>
    <version>1.1.1</version>
    <type>pom</type>
</dependency>

I am not getting errors, but I cannot use the java class from my java source.

I also included the following plugin

<plugin>
    <groupId>com.simpligility.maven.plugins</groupId>
    <artifactId>android-maven-plugin</artifactId>
    <version>4.6.0</version>
    <extensions>true</extensions>
</plugin>

I know that this library is not available at maven central, so I added jcenter as additional repository:

<repository>
    <id>bintray-central</id>
    <name>Bintray Central Repository</name>
    <url>https://jcenter.bintray.com</url>
    <snapshots>
        <enabled>false</enabled>
    </snapshots>
</repository>

Any idea if it would be possible what I am trying to do?

0 Answers
Related