我正在努力找出一个正确的pom.xml来开发一个webservice项目,该项目应该部署在glassfish上。我需要jws和glassfish,因为我使用Silverlight应用程序提供的服务。
我的项目结构:
\
|-src-main
| |-webapp
| | |- WEB-INF
| | | |-sun-web.xml
| | | \-web.xml
| | |-clientaccesspolicy.xml
| | |-index.jsp
| | \jax-ws.xml
| |- java
| ...
|
pom.xml
我的当前pom文件看起来像那样(基于this和this post):
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"><modelVersion>4.0.0</modelVersion>
<groupId>com.example.web</groupId>
<name>${project.artifactId}</name>
<artifactId>example-ws</artifactId>
<packaging>war</packaging>
<version>0.1-SNAPSHOT</version>
<properties>
<gmaven.version>1.2</gmaven.version>
<groovy.version>1.7.9</groovy.version>
<slf4j.version>1.5.10</slf4j.version>
<jung2.version>2.0.1</jung2.version>
<glassfish.home>C:\Program Files\glassfish-3.1-b41\glassfish</glassfish.home>
<domain.username>admin</domain.username>
<passwordFile>${user.home}/passwd.local.file</passwordFile>
<hibernate.show_sql>true</hibernate.show_sql>
<domain-name>${artifactId}</domain-name>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.glassfish.maven.plugin</groupId>
<artifactId>maven-glassfish-plugin</artifactId>
<version>2.1</version>
<configuration>
<glassfishDirectory>${glassfish.home}</glassfishDirectory>
<domaindir>${project.build.directory}/domains</domaindir>
<user>${domain.username}</user>
<admin>${domain.username}</admin>
<!-- ${glassfish.home}/domains/${domain-name}/master-password -->
<passwordFile>${passwordFile}</passwordFile>
<debug>true</debug>
<echo>true</echo>
<domain>
<name>${domain-name}</name>
<adminPort>4848</adminPort>
</domain>
<components>
<component>
<name>${project.artifactId}</name>
<artifact>${project.build.directory}/${project.build.finalName}.war</artifact>
</component>
</components>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>wsgen</goal>
</goals>
<configuration>
<sei>com.example.CubeDataProviderImpl</sei>
<genWsdl>true</genWsdl>
<keep>true</keep>
<verbose>false</verbose>
</configuration>
</execution>
</executions>
<dependencies>
</dependencies>
</plugin>
</plugins>
</build>
当我执行mvn glassfish:start-domain时,我得到:
是否有人在Windows 7 / maven 2.2.1上使用maven成功部署应用程序?也许我应该切换到CARGO插件?