Maven嵌入式Glassfish插件 [英] Maven Embedded Glassfish plugin

查看:120
本文介绍了Maven嵌入式Glassfish插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < project>< p> 
...
< pluginRepositories>
< pluginRepository>
< id> glassfish-repository< / id>
< name>用于Glassfish的Java.net存储库< / name>
< url> http://download.java.net/maven/glassfish< / url>
< layout>预设< / layout>
<快照>
< enabled> true< / enabled>
< updatePolicy>永不< / updatePolicy>
< / snapshots>
< / pluginRepository>
< / pluginRepositories>
...
< build>
< plugins>
< plugin>
< groupId> org.glassfish< / groupId>
< artifactId> maven-embedded-glassfish-plugin< / artifactId>
< version> 3.0< / version>

<配置>
< goalPrefix> glassfish< / goalPrefix>
< app> $ {artifactId} .war< / app>
< contextRoot> $ {context.root}< / contextRoot>
< port> $ {http.port}< / port>
< / configuration>
< / plugin>
...
< / plugins>
< / build>
< / project>

当我运行 mvn glassfish:run 时,它正在寻找一个不同的插件,无法找到它:

  [信息]插件'org.apache.maven.plugins: maven-glassfish-plugin'不存在或没有找到有效的版本

任何想法?

解决方案

您没有调用正确的插件。它应该是:

pre $ mvn embedded-glassfish:run

实际上,我是这样使用它的(使用你声明的同一个插件库):

 <插件> 
< plugin>
< groupId> org.glassfish< / groupId>
< artifactId> maven-embedded-glassfish-plugin< / artifactId>
< version> 3.0< / version>
<配置>
< goalPrefix> glassfish< / goalPrefix>
< app> target / test.war< / app>
< port> 8080< / port>
< contextRoot> test< / contextRoot>
< / configuration>
<执行次数>
<执行>
<阶段>包< /阶段>
<目标>
< goal>跑步< / goal>
< /目标>
< /执行>
< /执行次数>
< / plugin>
< / plugins>

更新:以防万一,完全限定的名称这个插件应该是:

pre $ mvn org.glassfish:maven-embedded-glassfish-plugin:3.0:run

但是使用短名称适用于我。


I cannot seem to get the Maven Glassfish plugin working for the life of me:

<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>

When I run mvn glassfish:run, it is looking for a different plugin and cannot find it:

[INFO] The plugin 'org.apache.maven.plugins:maven-glassfish-plugin' does not exist or no valid version could be found

Any ideas?

解决方案

You're not invoking the right plugin. It should be:

mvn embedded-glassfish:run

Actually, I'm using it like this: (with the same plugin repository you declared):

<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>

Update: Just in case, the fully qualified name of this plugin would be:

mvn org.glassfish:maven-embedded-glassfish-plugin:3.0:run

But using the short name works for me.

这篇关于Maven嵌入式Glassfish插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆