我正在尝试启动一个Scage项目。我以前从未使用过Maven。
我创建了pom.xml文件,并使用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>
这很好。正如教程中所指出的,我还创建了主文件
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)
}
}
如本教程所述,我必须使用此命令来构建它
mvn clean package -Pwebstart
日志:
-------------------------------------------------------
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.
现在输出是
.jar file
而不是.jnlp file
,如果我双击.jar文件,也不会发生任何事情。任何想法出了什么问题?
最佳答案
您缺少pom.xml中的Webstart配置文件
查看scage示例项目内的pom.xml:https://code.google.com/p/scage/downloads/detail?name=scage-example-project.zip&can=2&q=
它非常大,但其中有东西已指定了配置文件
<project>
<profiles>
<profile>
<id>webstart</id>
...
</profile>
</profiles>
</project>