2013-06-13 1 views
1

J'utilise Enunciate comme un plugin Maven pour la génération de documentation API. Je veux que la documentation générée soit compressée, et jusqu'à présent, je n'ai pas trouvé de moyen de le faire. La documentation est générée, mais dans un répertoire et non dans un fichier zip. Voici un extrait de mon pom:Documentation de zipping générée avec Enunciate

  <plugin> 
      <!-- auto-generate docs for REST API --> 
      <groupId>org.codehaus.enunciate</groupId> 
      <artifactId>maven-enunciate-plugin</artifactId> 
      <configuration> 
       <configFile>enunciate.xml</configFile> 
       <!-- the directory where to put the docs --> 
       <docsDir>${project.parent.basedir}/VrmMisc/Docs/SMA_API</docsDir> 
       <!-- <docsSubdir>${project.parent.basedir}/VrmMisc/Docs/SMA_API</docsSubdir> --> 

      </configuration> 
      <executions> 
       <execution> 
        <goals> 
         <goal>docs</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 

La dépendance:

 <dependency> 
     <groupId>org.codehaus.enunciate</groupId> 
     <artifactId>enunciate-rt</artifactId> 
     <version>${enunciate.plugin.version}</version> 
     <exclusions> 
       <exclusion> 
       <artifactId>activation</artifactId> 
       <groupId>javax.activation</groupId> 
      </exclusion> 
      <exclusion> 
       <artifactId>enunciate-jaxws-ri-rt</artifactId> 
       <groupId>org.codehaus.enunciate</groupId> 
      </exclusion> 
      <exclusion> 
       <artifactId>enunciate-jersey-rt</artifactId> 
       <groupId>org.codehaus.enunciate</groupId> 
      </exclusion> 
      <exclusion> 
       <artifactId>jersey-server</artifactId> 
       <groupId>com.sun.jersey</groupId> 
       </exclusion> 
     </exclusions> 
    </dependency> 

J'utilise la version Enunciate 1.26.2.

+0

Avez-vous essayé de configurer le 'but' pour qu'il soit' assemblé'? par exemple. ' assembler' –

Répondre

2

Si vous dites Enunciate à « exporter » l'objet « docs » dans un fichier (au lieu d'un répertoire) Enunciate sera zipper pour vous:

<plugin> 
     <!-- auto-generate docs for REST API --> 
     <groupId>org.codehaus.enunciate</groupId> 
     <artifactId>maven-enunciate-plugin</artifactId> 
     <configuration> 
      <configFile>enunciate.xml</configFile> 
      <exports> 
       <docs>${project.parent.basedir}/VrmMisc/Docs/SMA_API.zip</docs> 
      </exports> 
     </configuration> 
     <executions> 
      <execution> 
       <goals> 
        <goal>docs</goal> 
       </goals> 
      </execution> 
     </executions> 
    </plugin> 
0

Une autre solution sera de lancer un Commande Shell pour rendre un fichier WAR facilement déployable sur Tomcat

#!/bin/bash 
filename=enunciate.war 
directory=enunciate_directory 
echo $filename building starts ... 
cd $directory 
jar -cf $filename * 
Questions connexes