Frage

Ich habe mit maven-Glassfish-Plugin gerade erst begonnen. Ich habe das Ziel, Arbeits Start-Domäne. Allerdings, wenn ich versuche, das deploy Ziel auszuführen, denkt das Plugin, dass die Domain nicht gestartet wird und versucht, es neu zu starten - das ist offensichtlich versagt. Siehe Protokoll unter:

> mvn glassfish:start-domain
[INFO] --- maven-glassfish-plugin:2.1:start-domain (default-cli) @ arquillian-sample ---
[INFO] Deprecated syntax, instead use:
[INFO] asadmin --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --user admin --echo --terse=false start-domain [options] ...
[INFO] asadmin --host localhost --port 4848 --user admin --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --echo=true --terse=false start-domain --debug=true --domaindir C:\apps\glassfish-3.0.1\glassfish\domains --help=false --upgrade=false --verbose=false domain1
[INFO] Waiting for DAS to start ...
[INFO] Started domain: domain1
[INFO] Domain location: C:\apps\glassfish-3.0.1\glassfish\domains\domain1
[INFO] Log file: C:\apps\glassfish-3.0.1\glassfish\domains\domain1\logs\server.log
[INFO] Admin port for the domain: 4848
[INFO] Debug port for the domain: 9009
[INFO] Command start-domain executed successfully.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

> mvn glassfish:deploy
[INFO] --- maven-glassfish-plugin:2.1:deploy (default-cli) @ arquillian-sample ---
[INFO] Domain domain1 isn't started. Starting it for you.
[INFO] Deprecated syntax, instead use:
[INFO] asadmin --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --user admin --echo --terse=false start-domain [options] ...
[INFO] asadmin --host localhost --port 4848 --user admin --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --echo=true --terse=false start-domain --debug=true --domaindir C:\apps\glassfish-3.0.1\glassfish\domains --help=false --upgrade=false --verbose=false domain1
[INFO] There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.
[INFO] Command start-domain failed.
[ERROR] Unable to start domain "domain1".
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
  1. Warum kann das Plugin erkennen, dass die Domain bereits begonnen hat?
  2. Warum bin ich alle die "Veraltete Syntax" Warnungen bekommen?

Zur Umgehung der Ausgabe # 1, habe ich einfach versucht, das deploy Ziel zu erteilen, wenn der Server nicht ausgeführt wird. Dieses Mal ist das deploy Ziel, den Server, sondern der Einsatz scheiterte mit der Meldung „CLI136 Port 0 soll ein numerischer Wert“ erfolgreich gestartet. Siehe unten:

> mvn glassfish:deploy
[INFO] --- maven-glassfish-plugin:2.1:deploy (default-cli) @ arquillian-sample ---
[INFO] Domain domain1 isn't started. Starting it for you.
[INFO] Deprecated syntax, instead use:
[INFO] asadmin --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --user admin --echo --terse=false start-domain [options] ...
[INFO] asadmin --host localhost --port 4848 --user admin --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --echo=true --terse=false start-domain --debug=true --domaindir C:\apps\glassfish-3.0.1\glassfish\domains --help=false --upgrade=false --verbose=false domain1
[INFO] Waiting for DAS to start ...
[INFO] Started domain: domain1
[INFO] Domain location: C:\apps\glassfish-3.0.1\glassfish\domains\domain1
[INFO] Log file: C:\apps\glassfish-3.0.1\glassfish\domains\domain1\logs\server.log
[INFO] Admin port for the domain: 4848
[INFO] Debug port for the domain: 9009
[INFO] Command start-domain executed successfully.
[INFO] Command deploy failed.
[ERROR] CLI136 Port 0 should be a numeric value.
[ERROR] Deployment of S:\Projects\archfirstunf\java\trunk\examples\arquillian-sample\target\arquillian-sample.war failed.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE

Was mache ich falsch?

Hier ist meine Plugin-Konfiguration:

<plugin>
    <groupId>org.glassfish.maven.plugin</groupId>
    <artifactId>maven-glassfish-plugin</artifactId>
    <version>2.1</version>
    <configuration>
        <glassfishDirectory>${glassfish.directory}</glassfishDirectory>
        <user>admin</user>
        <passwordFile>${glassfish.directory}/domains/domain1/config/domain-passwords</passwordFile>
        <domain>
            <name>domain1</name>
        </domain>
        <components>
            <component>
                <name>${project.artifactId}</name>
                <artifact>target/${project.build.finalName}.war</artifact>
            </component>
        </components>
        <debug>true</debug>
        <terse>false</terse>
        <echo>true</echo>
    </configuration>
</plugin>
War es hilfreich?

Lösung

Ich verwende die folgende Konfiguration (beachten Sie die httpPort und adminPort im domain Element):

<plugin>
    <groupId>org.glassfish.maven.plugin</groupId>
    <artifactId>maven-glassfish-plugin</artifactId>
    <version>2.1</version>
    <configuration>
        <glassfishDirectory>${glassfish.directory}</glassfishDirectory>
        <user>admin</user>
        <passwordFile>${glassfish.directory}/domains/domain1/config/domain-passwords</passwordFile>
        <domain>
            <name>domain1</name>
            <httpPort>8080</httpPort>
            <adminPort>4848</adminPort>
        </domain>
        <components>
            <component>
                <name>${project.artifactId}</name>
                <artifact>target/${project.build.finalName}.war</artifact>
            </component>
        </components>
        <debug>true</debug>
        <terse>false</terse>
        <echo>true</echo>
    </configuration>
</plugin>

Ohne sie die Dinge nicht wie erwartet funktioniert (obwohl sie eigentlich optional sein). Aber beginnen, den Einsatz (mit oder ohne dem Server gestartet), etc nur funktioniert gut für mich.

PS:. Ich erinnere mich nicht, wenn dies wichtig ist, aber ich bin mit der Version 2.2-SNAPSHOT des Plug-in


Update: Hier ist die genaue Konfiguration I Verwendung:

  <plugin>
    <groupId>org.glassfish.maven.plugin</groupId>
    <artifactId>maven-glassfish-plugin</artifactId>
    <version>2.2-SNAPSHOT</version>
    <configuration>
      <glassfishDirectory>${glassfish.home}</glassfishDirectory>
      <user>${domain.username}</user>
      <passwordFile>${glassfish.home}/domains/${project.artifactId}/master-password</passwordFile>
      <autoCreate>true</autoCreate>
      <debug>true</debug>
      <echo>true</echo>
      <skip>${test.int.skip}</skip>
      <domain>
        <name>${project.artifactId}</name>
        <httpPort>8080</httpPort>
        <adminPort>4848</adminPort> <!-- [ERROR] CLI136 Port 0 should be a numeric value. -->
      </domain>
      <components>
        <component>
          <name>${project.artifactId}</name>
          <!--artifact>${project.build.directory}/${project.build.finalName}.war</artifact-->
          <artifact>${project.build.directory}/${project.build.finalName}</artifact>
        </component>
      </components>
    </configuration>
  </plugin>

Und hier ist die Ausgabe erhalte ich:

$ mvn glassfish:deploy 
[INFO] Scanning for projects...
...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-glassfish-testcase Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-glassfish-plugin:2.2-SNAPSHOT:deploy (default-cli) @ maven-glassfish-testcase ---
...
[INFO] asadmin --host localhost --port 4848 --user admin --passwordfile /home/pascal/opt/glassfishv3/glassfish/domains/maven-glassfish-testcase/master-password --interactive=false --echo=true --terse=true deploy --name maven-glassfish-testcase --force=false --precompilejsp=false --verify=false --enabled=true --generatermistubs=false --availabilityenabled=false --keepreposdir=false --keepfailedstubs=false --logReportedErrors=true --upload=false --help=false /home/pascal/Projects/stackoverflow/maven-glassfish-testcase/target/maven-glassfish-testcase
[INFO] Application deployed successfully with name maven-glassfish-testcase.
[INFO] 
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
...

Beachten Sie, dass ich keine weird „veraltet“ -Meldung. Und die Dinge einfach funktionieren.

Hinzufügen und httpport Admin fügt eine neue Komplikation -. Jetzt die Authentifizierung fehlschlägt, wenn ich das deploy (obwohl die gleiche Authentifizierung für das Start-Domain Ziel ist vorbei)

> mvn glassfish:start-domain
[INFO] --- maven-glassfish-plugin:2.2-SNAPSHOT:start-domain (default-cli) @ arquillian-sample ---
[INFO] Deprecated syntax, instead use:
[INFO] asadmin --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --user admin --echo --terse=false start-domain [options] ...
[INFO] asadmin --host localhost --port 4848 --user admin --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --echo=true --terse=false start-domain --debug=true --domaindir C:\apps\glassfish-3.0.1\glassfish\domains --help=false --upgrade=false --verbose=false domain1
[INFO] Waiting for DAS to start ...........
[INFO] Started domain: domain1
[INFO] Domain location: C:\apps\glassfish-3.0.1\glassfish\domains\domain1
[INFO] Log file: C:\apps\glassfish-3.0.1\glassfish\domains\domain1\logs\server.log
[INFO] Admin port for the domain: 4848
[INFO] Debug port for the domain: 9009
[INFO] Command start-domain executed successfully.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

> mvn glassfish:deploy
[INFO] --- maven-glassfish-plugin:2.2-SNAPSHOT:deploy (default-cli) @ arquillian-sample ---
[INFO] Deprecated syntax, instead use:
[INFO] asadmin --port 4848 --host localhost --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --user admin --echo --terse=false deploy [options] ...
[INFO] Command deploy failed.
[ERROR] Authentication failed for user: admin
[ERROR] (Usually, this means invalid user name and/or password)
[ERROR] Deployment of S:\Projects\archfirstunf\java\trunk\examples\arquillian-sample\target\arquillian-sample.war failed.
[ERROR] For more detail on what might be causing the problem try running maven with the --debug option
[ERROR] or setting the maven-glassfish-plugin "echo" property to "true".
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.973s
[INFO] Finished at: Wed Nov 10 01:51:04 EST 2010
[INFO] Final Memory: 10M/183M
[INFO] ------------------------------------------------------------------------

Ändern Version 2.2-SNAPSHOT macht keinen Unterschied. BTW die Snapshot ist nicht verfügbar in dem java.net Repository - ich hatte hier, um es zu bekommen:

    <pluginRepository>
        <id>ocean</id>
        <url>http://maven.ocean.net.au/snapshot</url>
        <releases>
            <enabled>false</enabled>
            <updatePolicy>never</updatePolicy>
        </releases>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </pluginRepository>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top