Maven Glassfishプラグイン:爆発したディレクトリ/フォルダーとしてアプリケーションを展開
-
27-09-2019 - |
質問
パッケージ化された戦争ファイルではなく、ディレクトリとしてjavaee-applicationをディレクトリとして展開する必要があります。 Maven Glassfishプラグインを使用してGlassfishにディレクトリを展開することは可能ですか?
管理コンソールでは、可能です。しかし、私はコマンドラインでそれをすることもできたいと思っています。
解決
次の構成は私のために機能します(に注意してください artifact
要素はディレクトリを指します):
<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>
</domain>
<components>
<component>
<name>${project.artifactId}</name>
<artifact>${project.build.directory}/${project.build.finalName}</artifact>
</component>
</components>
</configuration>
</plugin>
結果として asadmin
コマンドは次のとおりです。
asadmin --host localhost --port 4848 --user admin --passwordfile /home/pascal/opt /glassfishv3/glassfish/domains/maven-glassfish-testcase/master-password --interac tive=false --echo=true --terse=true deploy --name maven-glassfish-testcase --forc e=false --precompilejsp=false --verify=false --enabled=true --generatermistubs=fa lse --availabilityenabled=false --keepreposdir=false --keepfailedstubs=false --lo gReportedErrors=true --upload=false --help=false /home/pascal/Projects/stackoverf low/maven-glassfish-testcase/target/maven-glassfish-testcase
他のヒント
Mavenプラグインで動作させることはできませんでしたが、Glassfish/BinディレクトリのAsadminコマンドを使用してコマンドラインからGlassfishに展開することができます。
asadmin deploy - contextroot context_root path_to_ear_or_directory
所属していません StackOverflow