1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question How to setup a project using Maven

Discussion in 'Developer Support' started by haskabab, Jan 30, 2018.

  1. haskabab

    Joined:
    Nov 21, 2017
    Messages:
    16
    Likes Received:
    2
    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 (Text):
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <project xmlns="http://maven.apache.org/POM/4.0.0"
    3.          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    4.          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    5.     <modelVersion>4.0.0</modelVersion>
    6.  
    7.     <groupId>com.haskabab</groupId>
    8.     <artifactId>bots</artifactId>
    9.     <version>1.0-SNAPSHOT</version>
    10.     <build>
    11.         <plugins>
    12.             <plugin>
    13.                 <groupId>org.apache.maven.plugins</groupId>
    14.                 <artifactId>maven-compiler-plugin</artifactId>
    15.                 <configuration>
    16.                     <source>1.8</source>
    17.                     <target>1.8</target>
    18.                 </configuration>
    19.             </plugin>
    20.         </plugins>
    21.     </build>
    22.     <packaging>jar</packaging>
    23.  
    24.     <name>Runemate Bots Mvn</name>
    25.  
    26.     <dependencies>
    27.         <dependency>
    28.             <groupId>com.runemate</groupId>
    29.             <artifactId>runemate</artifactId>
    30.             <version>1.0</version>
    31.             <scope>system</scope>
    32.             <systemPath>D:/Software/RuneMate/RuneMate.jar</systemPath>
    33.         </dependency>
    34.     </dependencies>
    35.  
    36. </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
     

Share This Page

Loading...