Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Module - Apt
-
Labels:None
-
Environment:Window XP
-
Number of attachments :
Description
The project is a multi pom project. In the main pom project, I declare the other pom like this :
<modules> <module>../moduleA</module> <module>../moduleB</module> ... </modules>
To avoid duplicate code,I use the macro snippet in my documentation in modules A, B and Main. For convenient, the following syntax :
%{snippet|id=myid|file=src/main/java/mypackage/File.java}
.
When I build the site from each module A or B, all work fine. But when the site was generated from the main module, the snippet seem not work : All the pages who include a snippet's macros in A or B are not generated. I obtain the same problem if i do a simple site or a site:stage
The maven site work fine work include pictures and schemas of local documentation (in A et B). I try to use
the velocity macro and transform MyFile.apt to MyFile.apt.vm like these :
MyFile.apt.vm
%{snippet|id=myid|file=${basedir}/src/main/java/mypackage/File.java}.
It's fail too.
I use maven 2.1.0
Sorry for my poor english
Issue Links
- depends upon
-
DOXIA-224
Add source name in parser
-
Activity
| Fix Version/s | 1.2 [ 14082 ] |
| Fix Version/s | 1.2 [ 14082 ] |
| Description |
The project is a multi pom project. In the main pom project, I declare the other pom like this :
<modules> <module>../moduleA</module> <module>../moduleB</module> ... </modules> To avoid duplicate code,I use the macro snippet in my documentation in modules A, B and Main. For convenient, the following syntax : %{snippet|id=myid|file=src/main/java/mypackage/File.java}. When I build the site from each module A or B, all work fine. But when the site was generated from the main module, the snippet seem not work : All the pages who include a snippet's macros in A or B are not generated. I obtain the same problem if i do a simple site or a site:stage The maven site work fine work include pictures and schemas of local documentation (in A et B). I try to use the velocity macro and transform MyFile.apt to MyFile.apt.vm like these : MyFile.apt.vm %{snippet|id=myid|file=${basedir}/src/main/java/mypackage/File.java}. It's fail too. I use maven 2.1.0 Sorry for my poor english |
The project is a multi pom project. In the main pom project, I declare the other pom like this :
{code:xml} <modules> <module>../moduleA</module> <module>../moduleB</module> ... </modules> {code} To avoid duplicate code,I use the macro snippet in my documentation in modules A, B and Main. For convenient, the following syntax : {noformat} %{snippet|id=myid|file=src/main/java/mypackage/File.java} {noformat}. When I build the site from each module A or B, all work fine. But when the site was generated from the main module, the snippet seem not work : All the pages who include a snippet's macros in A or B are not generated. I obtain the same problem if i do a simple site or a site:stage The maven site work fine work include pictures and schemas of local documentation (in A et B). I try to use the velocity macro and transform {{MyFile.apt}} to {{MyFile.apt.vm}} like these : {noformat} MyFile.apt.vm %{snippet|id=myid|file=${basedir}/src/main/java/mypackage/File.java}. {noformat} It's fail too. I use maven 2.1.0 Sorry for my poor english |
| Component/s | Module - Apt [ 12814 ] |
Hi,
I found a hint of the Problem in:
https://svn.apache.org/repos/asf/maven/doxia/doxia/tags/doxia-1.1.1/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractParser.java
At line 89.
Based on this hint i found a temporary workaround (maybe someone other want know it).
1. I create a Class with "public static void main(String[] args)":
public static void main(final String[] args) {
{ System.out.println("[ERROR]: This Class needs exacly one argument: The Projects basedir! " // + "The args was: " + Arrays.toString(args)); }if (args.length != 1)
// set the SystemProperty
System.setProperty("basedir", args[0]);
System.out.println("[INFO]: Set SystemProperty 'basedir' successfull to: " + args[0]);
}
2. And added this Class (e.g.: "com.myProject.MyClass") to the projects pom.xml:
<plugin>
{basedir}<!-- Workaround for Maven Site generation Bug: "Macro snippet with file option in a multi-pom project" -->
<!-- Bugreport: DOXIA-373 See: http://jira.codehaus.org/browse/DOXIA-373 -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>site-plugin-bugfix-workaround</id>
<phase>pre-site</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>com.myProject.MyClass</mainClass>
<arguments>
<argument>$
</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
Now this Project works also in multi-pom projects.
regards,
Harald