我似乎不能让Maven Glassfish插件在我的生命中工作:
<project>
...
<pluginRepositories>
<pluginRepository>
<id>glassfish-repository</id>
<name>Java.net Repository for Glassfish</name>
<url>http://download.java.net/maven/glassfish</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
...
<build>
<plugins>
<plugin>
<groupId>org.glassfish</groupId>
<artifactId>maven-embedded-glassfish-plugin</artifactId>
<version>3.0</version>
<configuration>
<goalPrefix>glassfish</goalPrefix>
<app>${artifactId}.war</app>
<contextRoot>${context.root}</contextRoot>
<port>${http.port}</port>
</configuration>
</plugin>
...
</plugins>
</build>
</project>当我运行mvn glassfish:run时,它正在寻找一个不同的插件,但找不到:
[INFO] The plugin 'org.apache.maven.plugins:maven-glassfish-plugin' does not exist or no valid version could be found有什么想法吗?
发布于 2010-02-11 01:55:08
您没有调用正确的插件。它应该是:
mvn embedded-glassfish:run实际上,我是这样使用它的:(使用您声明的同一个插件存储库):
<plugins>
<plugin>
<groupId>org.glassfish</groupId>
<artifactId>maven-embedded-glassfish-plugin</artifactId>
<version>3.0</version>
<configuration>
<goalPrefix>glassfish</goalPrefix>
<app>target/test.war</app>
<port>8080</port>
<contextRoot>test</contextRoot>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>更新:以防万一,此插件的完全限定名称为:
mvn org.glassfish:maven-embedded-glassfish-plugin:3.0:run但是使用短名称对我来说很管用。
发布于 2010-04-16 20:07:45
@沃尔特·怀特(不知道/不知道如何回复你的评论,所以我改为回答):我读到过分散的战争是not fully supported by embedded GlassFish v3的。
就我个人而言,我正在焦急地等待带有Timer和MessageDriven支持的v3.1。希望web服务支持也将包括在内。有没有人恰好有关于v3.1的ETA的线索?
附言:mvn org.glassfish:maven-embedded-glassfish-plugin:3.0:run为我工作。现在将把它连接到正确的maven集成测试生命周期中。
发布于 2010-02-11 01:49:03
这个问题是由于两个不同的maven-glassfish插件同名而导致的。试着使用
mvn org.glassfish:maven-glassfish-plugin:run关于这个问题的详细解释,你可以找到here。
https://stackoverflow.com/questions/2238665
复制相似问题