hi,
ich habe mir mal die POM etwas genauer angeschaut...
[XML]
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.8.1</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaDirectory>src/main/resources/schema</schemaDirectory>
<schemaIncludes>
<include>nab.xsd</include>
</schemaIncludes>
<generatePackage>com.pack.xml</generatePackage>
<generateDirectory>${basedir}/src/main/java</generateDirectory>
</configuration>
</execution>
</executions>
</plugin>
[/xml]
Da würde ich zuerst einmal das Schema Directory wie folgt setzen:
[XML]
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.8.1</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaDirectory>src/main/xsd</schemaDirectory>
<generatePackage>com.pack.xml</generatePackage>
</configuration>
</execution>
</executions>
</plugin>
[/xml]
Möglichst immer die Defaults der Plugins beachten und so wenig wie möglich konfigurieren...
Die XSD Dateien nach src/main/xsd legen. Generierten Code niemals nach src/... da alle Plugins immer nach target/irgendwas generieren...ausser man hat einen wirklich guten Grund...
Alternativ das
jaxb2 plugin von Codehaus nutzen, da sind meiner Meinung bessere defaults für das Schema Verzeichnis enthalten (ist aber Geschmacksfrage..)
[xml]
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
[/xml]
Warum nicht eine aktuelle Version vom
maven-compiler-plugin nutzen (aktuell 2.3.2)..
So jetzt zu jaxws-maven-plugin:
[xml]
<!-- Plugin to generate JAXB classes and webservice interface -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<wsdlDirectory>src\main\webapp\WEB-INF\wsdl</wsdlDirectory>
<sourceDestDir>${basedir}/gen/src/main/java</sourceDestDir>
</configuration>
<dependencies>
<dependency>
<groupId>javax.jws</groupId>
<artifactId>jsr181-api</artifactId>
<version>1.0-MR1</version>
</dependency>
</dependencies>
</plugin>
[/xml]
Grundsäztlich keine "\" in Maven immer "/"...
Weiterhin ist das codehaus Plugin veraltet und wird hier
JAX-WS Maven plugin - Maven 2 JAX-WS Maven plugin — Java.net weitergeführt (steht auch auf der Web-Site
Mojo - Maven 2 Jaxws maven plugin).
Dann hier auch die
Plugin Defaults nutzen (src/wsdl) macht das Leben einfacher...Da auch zu beachten dass hier aktuellere Version vorhanden sind (org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.2:wsimport).
So wenn man das Obige beachtet ist das build-helper-plugin überflüssig als auch der Zusätzliche Eintrag für das maven-clean-plugin .
So für das
maven-surefire-plugin gilt auch: Aktuelle Versionen nutzen (2.12)...
[xml]
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<parallel>methods</parallel>
<threadCount>10</threadCount>
<excludes>
<exclude>**/integrationstest/*IT.java</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>integration-tests</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>false</skip>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/integrationstest/*IT.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
[/xml]
Weiterhin ist der Ausschluss der Integrationstest nicht notwendig. Dazu ist noch zu bemerken, dass Integrationstest nicht per maven-surefire-plugin ausgeführt werden sondern mithilfe des
maven-failsafe-plugin ausgeführt werden.
Die Defaults für
maven-surefire-plugin sind *Test.java, Test*.java und *TestCase.java während für die
Integrationstests *IT.java, IT*.java und ITCase.java
Das Glassfish-plugin würde ich in ein Profile packen, damit ich es bei Bedarf nutzen kann...spätestens bei einer Release wird das Nervig...
[xml]
<plugin>
<groupId>org.glassfish.maven.plugin</groupId>
<artifactId>maven-glassfish-plugin</artifactId>
<version>2.1</version>
<configuration>
<glassfishDirectory>C:\Programme\Glassfish\glassfish</glassfishDirectory>
<user>admin</user>
<adminPassword>adminadmin</adminPassword>
<debug>true</debug>
<echo>true</echo>
<domain>
<name>domain1</name>
<adminPort>4848</adminPort>
<resources>
<jdbcDataSource>
<name>jdbc/xe</name>
<type>dataSource</type>
<poolName>oracle</poolName>
<className>oracle.jdbc.pool.OracleDataSource</className>
<description>Some JDBC Connection Pool</description>
<allowNonComponentCallers>false</allowNonComponentCallers>
<validateConnections>true</validateConnections>
<validationMethod>metaData</validationMethod>
<properties>
<property>
<name>DataSourceName</name>
<value>OracleDataSource</value>
</property>
<property>
<name>password</name>
<value>admin</value>
</property>
<property>
<name>user</name>
<value>admin</value>
</property>
<property>
<name>URL</name>
<value>jdbc

racle:thin

db.....</value>
</property>
</properties>
</jdbcDataSource>
</resources>
</domain>
<components>
<component>
<name>web-service</name>
<artifact>${project.basedir}/target/web-service.war</artifact>
</component>
</components>
</configuration>
<executions>
<execution>
<id>deploy-glassfish</id>
<phase>pre-integration-test</phase>
<goals>
<goal>create-domain</goal>
<goal>deploy</goal>
</goals>
</execution>
<!-- <execution> <id>cleanup-glassfish</id> <phase>post-integration-test</phase>
<goals> <goal>delete-domain</goal> </goals> </execution> -->
</executions>
</plugin>
[/XML]
Gruß
Karl-Heinz Marbaise