User Tools

Site Tools


dev-guide:add-content-registry-descriptor

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

dev-guide:add-content-registry-descriptor [2024/12/04 14:31] – created gaetandev-guide:add-content-registry-descriptor [2024/12/04 18:54] (current) – [Generating a doclet xml file] gaetan
Line 7: Line 7:
 ==== Generating a doclet xml file ====  ==== Generating a doclet xml file ==== 
  
 +The doclets files are automatically created with the maven build of a project, if it contains the following information:
 +  * List of files to includes
 +  * Plugin execution in pom
 +
 +Both steps are defined in the pom.xml file of your project. They are added in the <build> section.
 +
 +=== Add files to be included ===
 +
 +The included files are moved from the source code to the correct repository by maven with the plugin:
 +
 +<code xml>
 +<plugin>
 + <artifactId>maven-resources-plugin</artifactId>
 + <version>3.0.2</version>
 + <executions>
 + <execution>
 + <id>copy-class-for-xmldoc</id>
 + <phase>generate-sources</phase>
 + <goals>
 + <goal>copy-resources</goal>
 + </goals>
 + <configuration>
 + <outputDirectory>${basedir}/target/source-xmldoc/de/grogra</outputDirectory>
 + <resources>
 + <resource>
 + <directory>src/main/java/de/grogra</directory>
 + <includes>
 + <include>rgg/Library.java</include>
 +                                                        
 +                                                        ...
 +                                                        
 +                                                        <include> OTHER FILES </includes>
 +                                                        
 +                                                        ...
 +                                                        
 +                                                <includes>
 + </resource>
 + </resources>
 + </configuration>
 + </execution>
 + <execution>
 + <id>move-xmldoc</id>
 + <phase>prepare-package</phase>
 + <goals>
 + <goal>copy-resources</goal>
 + </goals>
 + <configuration>
 + <outputDirectory>${basedir}/target/classes/xmldoc</outputDirectory>
 + <resources>
 + <resource>
 + <directory>${basedir}/target/site/apidocs/xmldoc</directory>
 + <includes>
 + <include>doclet.xml</include>
 + </includes>
 + </resource>
 + </resources>
 + </configuration>
 + </execution>
 + </executions>
 +</plugin>
 +</code>
 +
 +=== Declare the plugin execution ===
 +
 +This do not need to be modified:
 +
 +<code xml>
 +
 +<plugin>
 + <groupId>org.apache.maven.plugins</groupId>
 + <artifactId>maven-javadoc-plugin</artifactId>
 +        <configuration>
 +          <doclet>com.saxonica.xmldoclet.XmlDoclet</doclet>
 +          <useStandardDocletOptions>false</useStandardDocletOptions>
 +          <docletArtifacts>
 +     <docletArtifact>
 + <groupId>com.saxonica</groupId>
 + <artifactId>xmldoclet</artifactId>
 + <version>0.4.0</version>
 +     </docletArtifact>
 +   <docletArtifact>
 + <groupId>com.github.javaparser</groupId>
 + <artifactId>javaparser-core</artifactId>
 +        <version>3.25.4</version>
 +     </docletArtifact>
 +          </docletArtifacts>
 +          <doclint>none</doclint>
 + <destDir>xmldoc</destDir>
 + <overview></overview>
 + <sourcepath>${basedir}/target/source-xmldoc</sourcepath>
 + <additionalDependencies>
 + <additionalDependency>
 + <groupId>${project.groupId}</groupId>
 + <artifactId>${project.artifactId}</artifactId>
 + <version>${project.version}</version>
 + </additionalDependency>
 + </additionalDependencies>
 +      </configuration>
 + <executions>
 + <execution>
 + <id>generate-xml-doclet</id>
 + <phase>process-classes</phase>
 + <goals>
 + <goal>javadoc</goal>
 + </goals>
 + </execution>
 + </executions>
 +</plugin>
 +      
 +</code>
 +
 +=== Complete pom file example ===
 +
 +Look at the RGG plugin pom.xml file.
dev-guide/add-content-registry-descriptor.1733319104.txt.gz · Last modified: 2024/12/04 14:31 by gaetan