вторник, 18 декабря 2012 г.

Debug of maven plugins in Idea

Sometimes need to debug third-party maven plugins. This is really simple solution that I found using Idea 11.1.

For example we has next code:

          ...
          <plugins>  
                <plugin>  
                     <groupId>com.agilejava.docbkx</groupId>  
                     <artifactId>docbkx-maven-plugin</artifactId>
                     <version>2.0.14</version>
                     <configuration>  
                          <xincludeSupported>true</xincludeSupported>  
                          <highlightSource>true</highlightSource>  
                          <targetDirectory>${basedir}/target/site/</targetDirectory>  
                          <includes>index.xml</includes>                      
                     </configuration>  
                     <executions>  
                </plugin>  
           </plugins>  
          ...

For debug this plugin we need:

1. Add plugin artifact in project dependencies section
    <dependencies>
        <dependency>
            <groupId>com.agilejava.docbkx</groupId>
            <artifactId>docbkx-maven-plugin</artifactId>
            <version>2.0.14</version>
        </dependency>
    </dependencies>
    ...
    <build>
        <plugins>
            <plugin>
                <groupId>com.agilejava.docbkx</groupId>
                <artifactId>docbkx-maven-plugin</artifactId>
                <version>2.0.14</version>
                <configuration>
                    <xincludeSupported>true</xincludeSupported>
                    <highlightSource>true</highlightSource>
                    <targetDirectory>${basedir}/target/site/</targetDirectory>
                    <includes>index.xml</includes>
                </configuration>
            </plugin>
        </plugins>
    </build>

2. Click download sources, open needed source file
3. Start debugging!



Комментариев нет:

Отправить комментарий