How to setup Eclipse for CanaryMod API autocompletion?

CanaryMod related discussions

How to setup Eclipse for CanaryMod API autocompletion?

Postby HermannnTheGerman » Sun Apr 17, 2016 3:37 pm

Hi there,

For my son I bought a book from Andy Hunt about learning Java by writing plugins for CanaryMod server. My son loves to play Minecraft and also wants to learn programming so I thought I could combine best of both worlds.

The book does not teach how to setup a proper development environment. Instead it suggests to use a text editor with Java syntax highlighting (Sublime). However, I believe that programming is a lot easier if you use a full featured development environment, e.g. Eclipse, that also supports autocompletion.

I found a page that explains how to setup Eclipse to enable referencing JavaDocs from CanaryMods Maven repositories:

http://www.poweredbyjeff.com/canarymod- ... -tutorial/

That page states, I have to create a Java project, convert it to a Maven project and then edit the pom.xml file to set the source control management URL to:

http://repo.visualillusionsent.net/repository/public/

However, that does not work for me. Eclipse shows the error message "No versions available for net.canarymod:CanaryLib:jar:[1.0.0,) within specified range"

If I point the browser to the above URL at visualillusionsent.net, I get an error 404 page.

Is the repo down or has it moved? Did I miss something?

Thanks a lot for any help or advice.
HermannnTheGerman
 
Posts: 3
Joined: Sun Apr 17, 2016 2:28 pm

Re: How to setup Eclipse for CanaryMod API autocompletion?

Postby WWOL » Tue Apr 19, 2016 8:04 am

It does seem that the repo isn't at that URL anymore. You could try get on the irc to talk to someone who may know, sorry I don't.
You could build against CanaryLib yourself or put a downloaded lib in <your maven repo>/repository/net/canarymod/CanaryLib/1.2.0-SNAPSHOT although you would also need to setup vi utils too.
User avatar
WWOL
 
Posts: 12
Joined: Wed Sep 02, 2015 2:12 am

Re: How to setup Eclipse for CanaryMod API autocompletion?

Postby HermannnTheGerman » Tue Apr 19, 2016 7:58 pm

Hi WWOL,

Thank you for your reply and for confirming that the provided SCM URL is outdated and no longer valid.

I skimmed through pom.xml at GitHub

https://github.com/CanaryModTeam/Canary ... er/pom.xml

and found this promising URL:

http://repo.visualillusionsent.net/repository/internal/

However, I don't know nothing about Maven and its configuration. Therefore I'm at a loss whether this URL is a valid replacement for the outdated SCM URL. It's just try and error for me currently. At least, this URL is valid and, using a browser, I can further recurse into

net/canarymod/CanaryLib/1.2.0/

but Eclipse now gives me the following error message:

"Missing artifact net.canarymod:CanaryLib:jar:1.2.0 pom.xml /Test-Java-Project line 28 Maven Dependency Problem"
HermannnTheGerman
 
Posts: 3
Joined: Sun Apr 17, 2016 2:28 pm

Re: How to setup Eclipse for CanaryMod API autocompletion?

Postby WWOL » Wed Apr 20, 2016 9:58 am

Hi there, good find with that URL.
I'm not sure if it's intended for public use but it does seem to work.

I can't really help with that error without more info but I did get a project to build correctly using the following pom.xml

Code: Select all
<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>mccarthy.brian.zaptree</groupId>
  <artifactId>ZapTree</artifactId>
  <version>0.0.1</version>
  <name>ZapTree</name>
 
  <dependencies>
    <dependency>
      <groupId>net.canarymod</groupId>
      <artifactId>CanaryLib</artifactId>
      <version>1.2.0</version>
    </dependency>
  </dependencies>
   
  <repositories>
    <repository>
      <id>vi-repo</id>
      <name>Visual Illusions Repository</name>
      <url>http://repo.visualillusionsent.net/repository/internal/</url>
    </repository>
  </repositories>
</project>

User avatar
WWOL
 
Posts: 12
Joined: Wed Sep 02, 2015 2:12 am

Re: How to setup Eclipse for CanaryMod API autocompletion?

Postby HermannnTheGerman » Wed Apr 20, 2016 7:58 pm

Hi WWOL,

Thanks for providing this pom.xml file. I removed the <SCM></SCM> part in my pom.xml file and added the <repositories></repositories> element of your pom.xml file, basically recreating your pom.xml file:

Code: Select all
<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>de.Test-Java-Project</groupId>
  <artifactId>Test-Java-Project</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>Test-Java-Project</name>
  <description>Description missing</description>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
<repositories>
    <repository>
      <id>vi-repo</id>
      <name>Visual Illusions Repository</name>
      <url>http://repo.visualillusionsent.net/repository/internal/</url>
    </repository>
  </repositories>
  <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencies>
     <dependency>
        <groupId>net.canarymod</groupId>
        <artifactId>CanaryLib</artifactId>
        <version>1.2.0</version>
     </dependency>
  </dependencies>
</project>


Building (Run as -> maven install) takes much longer now, that's very encouraging.

However, it stops with a different error message regarding "viutils":

Code: Select all
...
[DEBUG] Using connector AetherRepositoryConnector with priority 3.4028235E38 for https://libraries.minecraft.net
[INFO] Downloading: https://libraries.minecraft.net/net/visualillusionsent/viutils/1.4.1/viutils-1.4.1.pom
[DEBUG] Writing tracking file C:\Users\dad\.m2\repository\net\visualillusionsent\viutils\1.4.1\viutils-1.4.1.pom.lastUpdated
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=2, ConflictMarker.markTime=1, ConflictMarker.nodeCount=24, ConflictIdSorter.graphTime=1, ConflictIdSorter.topsortTime=1, ConflictIdSorter.conflictIdCount=20, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=9, ConflictResolver.conflictItemCount=23, DefaultDependencyCollector.collectTime=649, DefaultDependencyCollector.transformTime=17}
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.201 s
[INFO] Finished at: 2016-04-20T21:07:37+02:00
[INFO] Final Memory: 14M/177M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Test-Java-Project: Could not resolve dependencies for project de.Test-Java-Project:Test-Java-Project:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at net.canarymod:CanaryLib:jar:1.2.0 -> net.visualillusionsent:viutils:jar:1.4.1: Failed to read artifact descriptor for net.visualillusionsent:viutils:jar:1.4.1: Could not transfer artifact net.visualillusionsent:viutils:pom:1.4.1 from/to mojang (https://libraries.minecraft.net): Access denied to https://libraries.minecraft.net/net/visualillusionsent/viutils/1.4.1/viutils-1.4.1.pom. Error code 403, Forbidden -> [Help 1]

Looks like Maven/Eclipse tries to download an artifact from

https://libraries.minecraft.net/net/visualillusionsent/viutils/1.4.1/viutils-1.4.1.pom

but gets an HTTP 403 "forbidden" error. To me that's not surprising as I'd not expect that any of the visualillusionsent artifacts (e.g. viutils) would be available from mojang's servers. What is surprising is, that "viutils" is not downloaded from http://repo.visualillusionsent.net/ or similar servers in that domain.
HermannnTheGerman
 
Posts: 3
Joined: Sun Apr 17, 2016 2:28 pm

Re: How to setup Eclipse for CanaryMod API autocompletion?

Postby WWOL » Thu Apr 21, 2016 6:43 am

I guess it couldn't find it in the vi repo for some reason and tried the MC one, I'm not 100% on how Maven works.
You could try http://nexus.visualillusionsent.net/con ... ps/public/ as the VI url.
User avatar
WWOL
 
Posts: 12
Joined: Wed Sep 02, 2015 2:12 am


Return to Discussions

Who is online

Users browsing this forum: No registered users and 0 guests

cron