2015-04-07 1 views
0

J'ai intégré framework enunciate pour générer le document API pour le projet Spring RESTful. J'ai suivi les étapes de https://github.com/stoicflame/enunciate/wiki/Executables et déployé la guerre créée à partir de la configuration énoncée dans le serveur Tomcat (http://localhost:8080/sample_enunciate) mais son affichant le document vide. Ici, j'ai fourni les détails de configuration utilisés dans le projet exemple.Enunciate framework - Ne fonctionne pas avec le projet Spring Restful

REMARQUE: Mais la configuration similaire fonctionne avec le projet Jersey reposful. Je suis vraiment coincé ici. S'il vous plaît laissez-moi savoir, est ce bug avec l'intégration du cadre enonce avec le projet Spring. Merci d'avance.

configuration du projet:

java  -1.7.0 
tomcat  -6.0 &7.0 
ant  -1.9.4 
spring  -4.0.5 
enunciate -1.30 

pots:

enunciate-core-1.30-RC1.jar 
enunciate-core-annotations-1.30-RC1.j 
enunciate-core-rt-1.30-RC1.jar 
enunciate-java-client-1.30-RC1.jar 
enunciate-docs-1.30-RC1.jar 
enunciate-rt-1.30-RC1.jar 
enunciate-spring-app-rt-1.30-RC1.jar 
enunciate-spring-jaxws-rt-1.30-RC1.ja 

spring-aop-4.0.5.RELEASE.jar 
spring-beans-4.0.5.RELEASE.jar 
spring-context-4.0.5.RELEASE.jar 
spring-context-support-2.5.4.jar 
spring-core-4.0.5.RELEASE.jar 
spring-expression-4.0.5.RELEASE.jar 
spring-jdbc-4.0.5.RELEASE.jar 
spring-test-4.0.5.RELEASE.jar 
spring-tx-4.0.5.RELEASE.jar 
spring-web-4.0.5.RELEASE.jar 
spring-webmvc-4.0.5.RELEASE.jar 

Ceci est mon enunciate.xml.

enunciate.xml

<?xml version="1.0"?> 

<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> 

fichier de propriétés pour build.xml

enunciate_build.properties

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

Ceci est mon 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> 

Répondre