Question

I use wsgen from the jaxws-maven-plugin to generate web service artifacts from my @WebService java class (start from Java). My web service class injects an @EJB. I've included the javaee-api version 6 as a dependency.

Everything was working fine until I changed the javaee-api scope to provided. If I don't do this the javaee-api.jar gets included in my .war file, which I do not want.

Using provided shouldn't cause a compile failure. Someone else noticed this but not in maven.

Here's the relevant section from my pom.xml.

Thanks.

<build>
  <plugins>
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>jaxws-maven-plugin</artifactId>
      <version>1.12</version>
      <executions>
        <execution>
          <goals>
            <goal>wsgen</goal>
          </goals>
          <configuration>
            <sei>com.co.report.reports.ws.server.ReportService</sei>
            <genWsdl>false</genWsdl>
            <keep>true</keep>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>
<dependencies>
  <dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-api</artifactId>
    <version>6.0</version>
    <!--   Setting <scope>provided</scope> causes compile failure -->
    <scope>provided</scope>
  </dependency>

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top