3

maven-glassfish-pluginを使い始めたところです。開始ドメインの目標が機能するようになりました。ただし、デプロイゴールを実行しようとすると、プラグインはドメインが開始されていないと見なし、ドメインを再起動しようとします。これは明らかに失敗します。以下のログを参照してください。

> 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. ドメインがすでに開始されていることをプラグインが検出できないのはなぜですか?
  2. 「非推奨の構文」の警告がすべて表示されるのはなぜですか?

問題#1を回避するために、サーバーが実行されていないときにデプロイ目標を発行しようとしました。今回は、デプロイの目標によってサーバーが正常に起動しましたが、「CLI136ポート0は数値である必要があります」というメッセージが表示されてデプロイが失敗しました。下記参照:

> 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

私は何が間違っているのですか?

これが私のプラグイン構成です:

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

1 に答える 1

5

次の構成を使用しています(要素内のhttpPortとに注意してください)。adminPortdomain

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

それらがないと、物事は期待どおりに機能しませんでした(オプションであるはずですが)。しかし、開始、デプロイ(サーバーが開始されているかどうかに関係なく)などは、私にとっては問題なく機能します。

PS:これが重要かどうかは覚えていませんが、バージョン2.2-プラグインのSNAPSHOTを使用しています。


更新:これが私が使用する正確な構成です:

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

そして、これが私が得る出力です:

$ mvn glassfish:deploy
[情報]プロジェクトをスキャンしています...
..。
[情報]                                                                         
[情報]  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -------------------------
[INFO] Maven-glassfish-testcase MavenWebapp1.0の構築-スナップショット
[情報]  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -------------------------
[情報]
[情報]---maven-glassfish-plugin:2.2-SNAPSHOT:deploy(default-cli)@ maven-glassfish-testcase ---
..。
[情報]asadmin--host localhost --port 4848 --user admin --passwordfile / home / pastal / 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 / pastal / Projects / stackoverflow / maven-glassfish-testcase / target / maven-glassfish-testcase
[INFO]アプリケーションはmaven-glassfish-testcaseという名前で正常にデプロイされました。
[情報]
[情報]
[情報]  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -------------------------
[情報]成功を築く
[情報]  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -------------------------
..。

奇妙な「非推奨」メッセージは表示されないことに注意してください。そして、物事はうまくいきます。

httpPortとadminPortを追加すると、新しい問題が追加されます。デプロイを実行すると、認証が失敗します(start-domainゴールに同じ認証が渡されますが)。

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

バージョンを2.2-SNAPSHOTに変更しても違いはありません。ところで、スナップショットはjava.netリポジトリで利用できません-私はそれを取得するためにここに行かなければなりませんでした:

    <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>
于 2010-11-10T06:09:09.267 に答える