• Post Reply Bookmark Topic Watch Topic
  • New Topic

Generate REST api documentation using enunciate through ant build tool.  RSS feed

 
aiswarya lenin
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[size=12]Hi All,

Now I am trying to generate Rest api documentation using enunciate through ant build tool, but it generate only empty document. Please help me, I am new to enunciate , I don't know,where i did the mistakes. I hope you people help me out.Thanks in advance.

This is my enunciate.xml.


enunciate.xml

<?xml version="1.0"?>
<enunciate label="sample" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.30.xsd">
<api-classes>
<include pattern="com.sample.controller.*" />
</api-classes>

<modules>
<!-- Docs -->
<docs title="example" copyright="Example.com"/>
<webapp mergeWebXML="WebContent/WEB-INF/web.xml" />
<spring-app disabled="false" springVersion="4.0.5">
<springImport file="resources/dev/applicationContext.xml" />
<springImport file="WebContent/WEB-INF/rest-servlet.xml" />
</spring-app>

<c disabled="true" />
<csharp disabled="true" />
<java-client disabled="false" />
<cxf disabled="false" />
<gwt disabled="false" />
<jaxws-client disabled="true" />
<jaxws-ri disabled="true" />
<jaxws-support disabled="true" />
<jersey disabled="true" />
<xml disabled="false" />
<obj-c disabled="true" />
<rest disabled="false" />

</modules>
</enunciate>


properties file for build.xml


enunciate_build.properties

JAVA_HOME=C:/Java/jdk1.7.0/
tomcat.home=D:/xampp/tomcat

This is my build.xml

build.xml


<?xml version="1.0" encoding="UTF-8"?>
<project default = "enunciate">
<property file ="enunciate_build.properties"/>
<property name="lib.dir" value="../libs" />
<property name="src.dir" value="src"/>
<target name = "enunciate">
<path id= "enunciate.classpath">
<fileset dir = "${lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir ="${lib.dir}/modules/spring">
<include name="*.jar"/>
</fileset>
<fileset dir = "${JAVA_HOME}">
<include name = "lib/tools.jar"/>
</fileset>
</path>
<taskdef name="enunciate" classname = "org.codehaus.enunciate.main.EnunciateTask">
<classpath refid = "enunciate.classpath"/>
</taskdef>
<enunciate javacSourceVersion="1.7" javacTargetVersion="1.7" basedir = "${src.dir}" configFile="enunciate.xml">
<include name = "**/*.java"/>
<classpath refid= "enunciate.classpath"/>
<export artifactId="war.file" destination="${tomcat.home}/webapps/sample_enunciate.war"/>
</enunciate>

</target>
</project>

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!