I am trying to generate enunciate documentation form a mix of classes, all JAX-RS annotated, some coded inn java, some in clojure.
I have built a maven project that simply depends on a war file containing the service classes:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>maven-enunciate-plugin</artifactId>
<version>1.27</version>
<configuration>
<configFile>src/conf/enunciate.xml</configFile>
<additionalClasspathEntries>
${settings.localRepository}/com/ws/scholar/0.96-SNAPSHOT/scholar-0.96-SNAPSHOT.war
</additionalClasspathEntries>
</configuration>
<executions>
<execution>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.ws</groupId>
<artifactId>scholar</artifactId>
<version>0.96-SNAPSHOT</version>
<type>war</type>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
I cannot get any service documentation to generate.
When running mvn enunciate:docs -X, I see my classes "Noticed":
[DEBUG] Noticed class WEB-INF.classes.com.ws.scholar.resources.ClientResource in /.m2/repository/com/ws/scholar/0.96-SNAPSHOT/scholar-0.96-SNAPSHOT.war.
Can anyone offer guidance or corrections to my configuration?
Unfortunately, you can't just add a war as a dependency and have the classes therein get picked up on the classpath. A war isn't a jar.
Instead, you'll probably need to use the
attachClasses
parameter of themaven-war-plugin
to export your classes as a jar in addition to the war. Then you can depend on that jar like this: