Use Maven-glassfish-plugin

Source: Internet
Author: User
Tags glassfish

I used Maven-glassfish-plugin for a while before, and then suddenly failed to access the public repository (GFW) for a while, resulting in the abandonment of this usage.

Now I tried again on the nexus private server.

First, add the following configuration to Pom. xml.

<! -- This plugin is only used for developer to deploy war on local glassfish --> <plugin> <groupid> org. glassfish. maven. plugin </groupid> <artifactid> Maven-glassfish-plugin </artifactid> <version> 2.1 </version> <configuration> <glassfishdirectory>/home/chenshu/glassfish-3.1.2 </glassfishdirectory> <user> admin </user> <passwordfile> pwd </passwordfile> <autocreate> true </autocreate> <debug> true </debug> <echo> true </echo> <terse> true </terse> <domain> <Name> domain1 </Name> <adminport> 4848 </adminport> 

Run MVN glassfish: After deploy

An error occurs:

 
[Error] failed to execute goal Org. glassfish. maven. plugin: Maven-glassfish-plugin: 2.1: deploy (default-cli) on Project geoflow: Execution default-CLI of Goal Org. glassfish. maven. plugin: Maven-glassfish-plugin: 2.1: deploy failed: plugin Org. glassfish. maven. plugin: Maven-glassfish-plugin: 2.1 or one of its Dependencies cocould not be resolved: failed to collect dependencies for Org. glassfish. maven. plugin: Maven-glassfish-plugin: jar: 2.1 (): failed to read artifact descriptor for Org. apache. maven: Maven-plugin-API: jar: 2.1.0-M2-SNAPSHOT: cocould not find artifact Org. apache. maven: Maven-parent: pom: 11-snapshot in nexus (http: // turtleship: 8080/nexus/content/groups/Public)-> [help 1]

Said dependent Maven-plugin-API 2.1.0-M2-SNAPSHOT can not find the artifact (that is, can not find the jar package). It was originally caused by private server.

Log on to nexus and delete the Apache-Snapshot Repository from the public repository. Run it again.

Note that the development glassfish is installed together with netbeans7.1.2 to save time. In this development version, the username of glassfish3.1.2 is admin and the password is empty. Therefore, you must first create an empty file PWD in the project directory. If the empty file does not work, add a line:

As_admin_password =

Note that since the asadmin command line does not support the -- contextroot parameter, Maven-glassfish-plugin cannot modify the value of contextroot, which can only be specified in the sun-web.xml.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.