Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question How to setup a project using Maven

Joined
Nov 21, 2017
Messages
17
Hey guys,

I've been developing bots using IntelliJ and I've set it up as following:
- Added runemate.jar as a dependency using module settings
- Setup a run config which uses the com.runemate.boot.Boot & my login credentials + -sdk as program args.

Now that's running all fine and dandy. But now I've been looking into maven and adding 3rd party packages/libraries to add some nice features like Pusher and HTTP requests etc.

How would I set this up correctly? I've created a new maven project and adjusted the pom to the following:

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

    <groupId>com.haskabab</groupId>
    <artifactId>bots</artifactId>
    <version>1.0-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <packaging>jar</packaging>

    <name>Runemate Bots Mvn</name>

    <dependencies>
        <dependency>
            <groupId>com.runemate</groupId>
            <artifactId>runemate</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>D:/Software/RuneMate/RuneMate.jar</systemPath>
        </dependency>
    </dependencies>

</project>

As you can see I've tried adding the RuneMate.jar as a local dependency and this seems to be working (i have autocompletion etc.). And I've told maven to create a .jar file out of my java files.

Now when i run "mvn package" it does create a jar for me. However when i point runemate to the target folder containing the jar my bots are not found by the client.

So my question is; what is the proper way to setup Intellij with maven to I can use packages from maven and still be able to simple click run to build and launch runemate (which will find my bots when finished loading).

Thanks a lot in advance,
Haskabab
 
Top