nguillaumin/slick2d-maven

Could not find artifact javax.jnlp.jnlp

Closed this issue · 10 comments

Hi! There my system:

  • windows 7 64 bit
  • java 6.0_37
  • maven 3

Here my error:

[ERROR] Failed to execute goal on project slick2d-core: Could not resolve dependencies for project org.slick2d:slick2d-core:jar:2013.04-SNAPSHOT: Coul
d not find artifact javax.jnlp:jnlp-api:jar:5.0 at specified path C:\Program Files (x86)\Java\jdk1.6.0_37\jre\..\sample\jnlp\servlet\jnlp.jar -> [Help
 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project slick2d-core: Could not resolve dependencies for project org
.slick2d:slick2d-core:jar:2013.04-SNAPSHOT: Could not find artifact javax.jnlp:jnlp-api:jar:5.0 at specified path C:\Program Files (x86)\Java\jdk1.6.0
_37\jre\..\sample\jnlp\servlet\jnlp.jar
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:196)
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:108)
        at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:258)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:201)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project org.slick2d:slick2d-core:jar:2013.04-SNA
PSHOT: Could not find artifact javax.jnlp:jnlp-api:jar:5.0 at specified path C:\Program Files (x86)\Java\jdk1.6.0_37\jre\..\sample\jnlp\servlet\jnlp.j
ar
        at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:170)
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:171)
        ... 22 more
Caused by: org.sonatype.aether.resolution.DependencyResolutionException: Could not find artifact javax.jnlp:jnlp-api:jar:5.0 at specified path C:\Prog
ram Files (x86)\Java\jdk1.6.0_37\jre\..\sample\jnlp\servlet\jnlp.jar
        at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:412)
        at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:164)
        ... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact javax.jnlp:jnlp-api:jar:5.0 at specified path C:\Progra
m Files (x86)\Java\jdk1.6.0_37\jre\..\sample\jnlp\servlet\jnlp.jar
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:541)
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:220)
        at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:395)
        ... 24 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact javax.jnlp:jnlp-api:jar:5.0 at specified path C:\Program Fi
les (x86)\Java\jdk1.6.0_37\jre\..\sample\jnlp\servlet\jnlp.jar
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:260)
        ... 26 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

Thanks for your efforts!!

Slick2d depends on jnlp.jar which ships with the JDK, but in the "Samples" package. I think in Java 6 that was part of the JDK installer but you had to tick the box "Demo and samples" when installing. With Java 7 it's a separate download.

So if you don't have a samples sub directory under your JDK installation folder, you'll have to re-install it with the "Demo and samples" box ticked.

Let me know if it fixes it, I'll update the instructions

thanks for support. Here my solution:

  1. download from here http://www.astrogrid.org/maven/jnlp/jars/jnlp.jar and place in <JAVA_HOME>sample\jnlp\servlet
  2. run mvn clean install

My 2 cents: if user don't have a java installation with sample, you could tip to download jar or use maven to download it?

Problem is that it's not available on the official Maven repositories, possibly because of licensing issues ?

Using an alternative download is a bit tricky as you can't have a reliable source for the JAR in the correct version, apart from Oracle...

a workaround could be work with profiles: a base profiles with only library and one full with jnlp require the right jar ?

I'm not sure how that would work, can you expand a bit ?

A profile could be used to produce 2 artifacts with the same POM but it would violate the Maven principle of one artifact per POM, making the JARs difficult to distribute.

We could have a separate module for the JNLP stuff but that wouldn't really help since you'll still need JNLP to build everything at the parent level...

Yeah you are right, I can explain myself better.
If I'm a slick developer want slick library only and build a game using archetype, building all the stuff is too much. All I want is a game with slick.jar, lwjgl.jar and natives and my basic hello world.

Currently if I have jnlp.jar I can:

  1. build slick-core project using mvn clean install : this by defayult create jar, sources and javadoc.. a bit too much ?
  2. can I build a game using archetype and bulding only slick-core?

Same problem without jnlp.jar => i would like to build and stay update to slick withoyt jnlp.jar, if possible

What you describe is exactly the end-goal I want to reach, but it will only be possible once the Maven artifacts are in the Maven Central repository (See at the end of the README).

The only reason you need to build the project for now is that it's not available in Maven Central, so for your game to declare a dependency against slick-core you need to mvn install it first to put it in your local repository $HOME/.m2. Once the artifacts are in Maven Central all you'll need to do is just generate an archetype, or if you want to do without the archetype just declare a dependency on slick2d-core in your game's POM. Maven will take care of downloading the JAR and the dependencies (lwjgl, etc.)

Right now can I build slick-core with mvn clean install (without nothing in my local repo) and then use archetype ? I don't need jnlp.jar ?

mvn clean install is only needed once to install Slick 2D and the archetype on your machine. Once that's done you can use the archetype multiple times without having to build the project again.

jnlp.jar is needed for this initial step, to build Slick 2D, but shouldn't be needed after when you build a new project with the archetype (unless you need JNLP features of course).

ok now is clear 👍
So I understand maven central stuff.. one all is on maven central, what I need is use archetype and have my basic game.

thanks for support!