Page 1 of 1

Compilation JAVA json loader

Posted: Sun Feb 10, 2013 11:22 am
by Daboog
Hello iforce! What IDE are you used for JSON loader on JAVA. When I compile source code in NetBeanse, I get error:

Failed to execute goal on project jbox2d-testbed: Could not resolve dependencies for project org.jbox2d:jbox2d-testbed:jar:2.3.0-SNAPSHOT: The following artifacts could not be resolved: org.jbox2d:jbox2d-library:jar:2.3.0-SNAPSHOT, org.jbox2d:jbox2d-serialization:jar:1.0.0-SNAPSHOT, org.jbox2d:b2dJson:jar:1.0.0: Could not find artifact org.jbox2d:jbox2d-library:jar:2.3.0-SNAPSHOT -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.

Re: Compilation JAVA json loader

Posted: Sun Feb 10, 2013 1:42 pm
by iforce2d
I was using Eclipse for that. I'm not all that experienced with it, and even more confusing was maven... I ended up making the downloads by editing the contents of the jar directly using a zip program because I could not for the life of me figure out how to do it with mvn :?

I used some maven plugin for Eclipse, I forget the exact name and I am away from home for a while so I can't check right now, but I did all the compiling with that instead of using the command line.

Re: Compilation JAVA json loader

Posted: Sun Feb 10, 2013 9:43 pm
by Daboog
Oh, thanks! I realized what the problem was)

Re: Compilation JAVA json loader

Posted: Sun Aug 11, 2013 4:53 pm
by mynameisafruit
Daboog,

What did you do to resolve this? It looks like the pom.xml file for the java project may be incorrect.

Thank you,
Barry

Re: Compilation JAVA json loader

Posted: Sun Aug 11, 2013 5:50 pm
by mynameisafruit
I figured it out. I got this building with all maven managed dependencies. I updated the pom to look like:

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>
  <artifactId>b2dJson</artifactId>
  <groupId>com.iforce2d</groupId>
  <name>b2dJson</name>
  <packaging>jar</packaging>
  <description>Support for loading R.U.B.E scenes into JBox2D.</description>
  <version>1.0.0</version>
  <dependencies>
        <dependency>
                <groupId>org.jbox2d</groupId>
                <artifactId>jbox2d-library</artifactId>
                <version>2.2.1.1</version>
        </dependency>
         <dependency>
                <groupId>org.json</groupId>
                <artifactId>json</artifactId>
                <version>20090211</version>
        </dependency>

   </dependencies>
</project>
Really we're just dependent on the jbox2d-library and org.json libraries. I pointed to the latest org.jbox2d library and the latest org.json as dependencies, and removed the parent pom declaration. Then running

Code: Select all

mvn clean install
at the command line worked like a charm.

I'm going to try and submit a pull request to update the git repo so the pom is correct if you'll accept it!

Re: Compilation JAVA json loader

Posted: Sun Aug 11, 2013 6:12 pm
by iforce2d
Done, thankyou!