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.