9 maven-2 glassfish glassfish-embedded glassfish-3
我似乎无法让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>
Run Code Online (Sandbox Code Playgroud)
当我运行时mvn glassfish:run
,它正在寻找一个不同的插件,但无法找到它:
[INFO] The plugin 'org.apache.maven.plugins:maven-glassfish-plugin' does not exist or no valid version could be found
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
Pas*_*ent 14
你没有调用正确的插件.它应该是:
mvn embedded-glassfish:run
Run Code Online (Sandbox Code Playgroud)
实际上,我正在使用它:(使用您声明的相同插件存储库):
<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>
Run Code Online (Sandbox Code Playgroud)
更新:以防万一,此插件的完全限定名称为:
mvn org.glassfish:maven-embedded-glassfish-plugin:3.0:run
Run Code Online (Sandbox Code Playgroud)
但使用短名称对我有用.
归档时间: |
|
查看次数: |
12304 次 |
最近记录: |