Search code examples
javascalamavenjava-web-start

Maven - webstart could not be activated


I am trying to launch a Scage Project. I never used maven before.

I created a pom.xml file and downloaded the files with intellij

<?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>ScageTest</groupId>
    <artifactId>ScageTest</artifactId>
    <version>1.0</version>
    <repositories>

        <repository>
            <id>scage</id>
            <name>Scage Maven Repo</name>
            <url>http://scage.googlecode.com/svn/maven-repository</url>
        </repository>
    </repositories>

    <dependencies>

        <dependency>
            <groupId>su.msk.dunno</groupId>
            <artifactId>scage</artifactId>
            <version>0.9</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>


</project>

This worked just fine. I also created the main file, as pointed in the tutorial

import net.scage.ScageScreenApp
import net.scage.ScageLib._
import net.scage.support.Vec

    object HelloWorldExample extends ScageScreenApp("Hello World") {
      private var ang = 0f
      actionStaticPeriod(100) {
        ang += 5
      }

      backgroundColor = BLACK
      render {
        openglMove(windowSize/2)
        openglRotate(ang)
        print("Hello World!", Vec(-50, -5), GREEN)
      }
    }

As pointed in the tutorial I have to use this command to build it mvn clean package -Pwebstart

log:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ ScageTest ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: C:\Users\kanta\IdeaProjects\ScageTest\target\ScageTest-1.0.
jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.922s
[INFO] Finished at: Mon Oct 29 23:40:07 CET 2012
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "webstart" could not be activated because it doe
s not exist.

Now the output is a .jar file instead of a .jnlp file, also nothing happens if I doubleclick the .jar file.

Any ideas what went wrong?


Solution

  • You are missing the webstart profile in your pom.xml

    look at the pom.xml inside the scage example project: https://code.google.com/p/scage/downloads/detail?name=scage-example-project.zip&can=2&q=

    it is quite large, but among others has thing it has the profile specified

    <project>
        <profiles>
            <profile>
                <id>webstart</id>
                ...
            </profile>
        </profiles>
    </project>