You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "poulfich (JIRA)" <ji...@codehaus.org> on 2009/12/14 10:53:55 UTC

[jira] Created: (DOXIA-373) Macro snippet with file option in a multi-pom project

Macro snippet with file option in a multi-pom project
-----------------------------------------------------

                 Key: DOXIA-373
                 URL: http://jira.codehaus.org/browse/DOXIA-373
             Project: Maven Doxia
          Issue Type: Bug
         Environment: Window XP
            Reporter: poulfich


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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DOXIA-373) Macro snippet with file option in a multi-pom project

Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/DOXIA-373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=222019#action_222019 ] 

Lukas Theussl commented on DOXIA-373:
-------------------------------------

The problem is that current parsers don't know anything about the origin of the sources they are parsing, see DOXIA-224. The getBasedir() in AbstractParser returns the directory where the build is started, unless the system property "basedir" is set, so the workaround above is valid.

> Macro snippet with file option in a multi-pom project
> -----------------------------------------------------
>
>                 Key: DOXIA-373
>                 URL: http://jira.codehaus.org/browse/DOXIA-373
>             Project: Maven Doxia
>          Issue Type: Bug
>         Environment: Window XP
>            Reporter: poulfich
>             Fix For: 1.2
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DOXIA-373) Macro snippet with file option in a multi-pom project

Posted by "tischda (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/DOXIA-373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=256138#action_256138 ] 

tischda commented on DOXIA-373:
-------------------------------

I'm getting the file to parse from the target directory, in my index.apt.vm:

%{snippet|id=maven-local-repo|file=${project.build.outputDirectory}/settings.xml}

Now if I add a trailing space after the closing brace of the snippet macro, it fails the first time. The second time, the build succeeds but the index.html is empty. Remove the space, clean build and it works again.


> Macro snippet with file option in a multi-pom project
> -----------------------------------------------------
>
>                 Key: DOXIA-373
>                 URL: http://jira.codehaus.org/browse/DOXIA-373
>             Project: Maven Doxia
>          Issue Type: Bug
>         Environment: Window XP
>            Reporter: poulfich
>             Fix For: 1.2
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (DOXIA-373) Macro snippet with file option in a multi-pom project

Posted by "Andreas Veithen (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/DOXIA-373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=293713#comment-293713 ] 

Andreas Veithen commented on DOXIA-373:
---------------------------------------

A workaround for this issue is to use (assuming that the file is a Velocity templete, i.e. has suffix .apt.vm instead of .apt):

%{snippet|id=deployment|file=${project.basedir}/src/test/resources/client-config.wsdd}

                
> Macro snippet with file option in a multi-pom project
> -----------------------------------------------------
>
>                 Key: DOXIA-373
>                 URL: https://jira.codehaus.org/browse/DOXIA-373
>             Project: Maven Doxia
>          Issue Type: Bug
>         Environment: Window XP
>            Reporter: poulfich
>
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DOXIA-373) Macro snippet with file option in a multi-pom project

Posted by "Harald Brabenetz (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/DOXIA-373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=217983#action_217983 ] 

Harald Brabenetz commented on DOXIA-373:
----------------------------------------

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) {
        if (args.length != 1) {
            System.out.println("[ERROR]: This Class needs exacly one argument: The Projects basedir! " //
                + "The args was: " + Arrays.toString(args));
        }
        // 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>
        <!-- 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>${basedir}</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>

Now this Project works also in multi-pom projects.

regards,
Harald

> Macro snippet with file option in a multi-pom project
> -----------------------------------------------------
>
>                 Key: DOXIA-373
>                 URL: http://jira.codehaus.org/browse/DOXIA-373
>             Project: Maven Doxia
>          Issue Type: Bug
>         Environment: Window XP
>            Reporter: poulfich
>
> 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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DOXIA-373) Macro snippet with file option in a multi-pom project

Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/DOXIA-373?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukas Theussl updated DOXIA-373:
--------------------------------

    Fix Version/s: 1.2

> Macro snippet with file option in a multi-pom project
> -----------------------------------------------------
>
>                 Key: DOXIA-373
>                 URL: http://jira.codehaus.org/browse/DOXIA-373
>             Project: Maven Doxia
>          Issue Type: Bug
>         Environment: Window XP
>            Reporter: poulfich
>             Fix For: 1.2
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira