I'm attempting to create a basic maven site using the maven site plugin. So I added this to my pom:
<reporting>
<plugins>
<!--JavaDoc setup-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.7</version>
<configuration>
<defaultAuthor>Leon Blakey</defaultAuthor>
<defaultVersion>${project.version}</defaultVersion>
<links>
<link>http://download.oracle.com/javase/6/docs/api</link>
</links>
</configuration>
</plugin>
</plugins>
</reporting>
And ran mvn site --errors
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building pircbotx 1.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-site-plugin:2.0.1:site (default-site) # pircbotx ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.688s
[INFO] Finished at: Wed Jan 12 18:08:00 EST 2011
[INFO] Final Memory: 5M/13M
[INFO] ------------------------------------------------------------------------
W:\programming\pircbot-hg>
Hmm, odd that there's no output. So when I check target/site, its empty. The only folders are images/ , css/ , and WEB-INF/ , filled with some generic pictures. No javadoc and no site.
This is reproducible with mvn site:site and mvn org.apache.maven.plugins:maven-site-plugin:2.2:site (apparently maven only wants to use 2.0.1 by default)
Whats strange is that I can go back to maven 2.2.1 and successfully generate a site. But when I use 3.0.1-RC1 (happens to come with Netbeans), it fails.
What am I doing wrong that would make the site plugin fail in 3.0.1 but not 2.2.1?
Perhaps you can try using Maven Site Plugin 3.x. You can do that by adding the following in your pom.xml
<build>
...
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0-beta-3</version>
</plugin>
</plugins>
</build>
I was having the same problem. I found a blog post about the topic.
Quoting the blog (emphasis mine):
If you have been using the reporting section of the pom.xml file to generate code quality metrics, javadoc reports, and so forth, you may have a little work to do to migrate this feature into Maven 3. Indeed, the reporting and reportSets sections have been deprecated (it won't cause an error with Maven 3, it will just be ignored), and have been replaced by a reportPlugins section in the configuration block of the maven-site-plugin itself.
Ignoring the old <reporting> without any warning about it being deprecated seems a bit rude, but anyway...
So you are basically just moving your old reporting plugins into the configuration section of the new maven-site-plugin.
A section of the maven-plugin-site explains that they removed of all reporting logic from the core of Maven to "decouple the Maven core from Doxia and to allow arbitrary reporting systems to be developed." Makes sense.
Use of the Site Plugin ( http://maven.apache.org/plugins/maven-site-plugin/ ) with Maven 3 finally seems to be resolved. The (non-beta) version has been released, and the ability to use the version 2 style <reporting> structure in the pom.xml declaration has been added back.
Although it is (as usual) hard to navigate the substantial but unorganized and overlapping documentation about Maven 3 and the site plugin, one page - http://maven.apache.org/plugins/maven-site-plugin/maven-3.html - states that the old style is now recommended over the new "plugin to site plugin" style:
Note: In Maven 3, the new format does not support report plugins configuration inheritance: see MSITE-484. This format was technically necessary to remove reporting logic from Maven 3, but a new inheritance mechanism still needs to be added to Maven 3 to make it as flexible as the old format. So the new format is not ready for direct use for now.
The example page http://maven.apache.org/plugins/maven-site-plugin/examples/configuring-reports.html for configuring reports doesn't even mention the "new" formatting method.
Not sure if this is in a "best practice" form, but an example pom reporting section that works for me with a couple of extra reports is as follows; select your own plugins as desired.
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<!-- Default Site Pages -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.4</version>
</plugin>
<!-- Java Documentation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
</plugin>
<!-- Source Code Cross-Reference -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin>
...
</plugins>
</reporting>
As an aside, If you use the m2e plugin in Eclipse to edit your POMs, then you can use code completion in the version section of a plugin to give you a list of its current versions. Very handy.
Related
I am trying to obfuscate a jar-with-dependencies (although the same problem affects if I set as inFile the regular single jar).
I am using Java 8, but I have to use newer versions of Proguard and Proguard Maven Plugin, due to coverage of some jar dependencies that are from a higher version (otherwise I get an "Unsupported major-minor version" problem).
When executing "mvn clean install" the step is executed but I get a "proguard jar not found in pluginArtifacts error". See log below.
I have seen in Proguard Maven Plugin code that now you need (from 7.0.0) both proguard-base and proguard-core from com.guardsquare instead of the outdated previous version in net.sf.proguard - this one is not prepared for later jars.
Apparently the proguard jar is not found where I am specifying it - how should I include this dependency?
I am using this in my pom:
<build>
<plugins>
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals><goal>proguard</goal></goals>
<configuration>
<injar>${project.build.finalName}-jar-with-dependencies.jar</injar>
<outjar>${project.build.finalName}-small.jar</outjar>
<proguardVersion>7.1.0</proguardVersion>
<options>
<option>-allowaccessmodification</option>
<option>-dontoptimize</option>
<option>-dontshrink</option>
<option>-dontnote</option>
<option>-dontwarn</option> <!-- added option to ignore com.sun missing classes -->
<option>-keepattributes Signature</option>
</options>
<libs>
<lib>${java.home}/lib/rt.jar</lib>
</libs>
<dependencies>
<dependency>
<groupId>com.guardsquare</groupId>
<artifactId>proguard-base</artifactId>
<version>7.1.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.guardsquare</groupId>
<artifactId>proguard-core</artifactId>
<version>7.1.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.4.0</version>
</plugin>
<plugins>
<pluginManagement>
</build>
Running it with -X debug flag:
[... proguard execution command which ends in:]
-printseeds, 'C:\workspace\xxx\target\proguard_seed.txt', -verbose, -allowaccessmodification, -dontoptimize, -dontshrink, -dontnote, -dontwarn, -keepattributes Signature]
...
[DEBUG] pluginArtifact: C:\User\myuser\.m2\repository\org\eclipse\sisu\org.eclipse.sisu.inject\0.0.0.M5\org.eclipse.sisu.inject-0.0.0.M5.jar
[DEBUG] pluginArtifact: C:\User\myuser\.m2\repository\org\codehaus\plexus\plexus-component-annotations\1.5.5\plexus-component-annotations-1.5.5.jar
[DEBUG] pluginArtifact: C:\User\myuser\.m2\repository\org\codehaus\plexus\plexus-classworlds\2.4\plexus-classworlds-2.4.jar
[INFO] proguard jar not found in pluginArtifacts
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 40.302 s
[INFO] Finished at: 2021-08-17T18:26:45
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.wvengen:proguard-maven-plugin:2.3.1:proguard (default) on project xxx: Obfuscation failed ProGuard (proguard.ProGuard) not found in classpath -> [Help 1]
The jar-with-dependencies is generated with Maven Assembly plugin.
I am using Java 1.8.
I was actually using proguard.Proguard instead of proguard.ProGuard. Typo took a day out of me.
However, there is some extra trickyness associated, in case it helps anyone: proguard-maven-plugin would not let me define newer versions of proguard dependencies except for the default one. E.g. 2.4.0 would only allow me to use 7.1.0-beta3 which is the default. It didn't recognize the libraries I would set in the dependencies section inside the plugin (for example, for 7.1.1).
We are developing our own Eclipse plugin jars used by our Eclipse-based application. We are currently using proguard-maven-plugin version 2.0.8 to obfuscate them. However, when running mvn install on some plugins, we are currently encountering the following error:
[INFO] ---------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ---------------------------------------------------------------------
[INFO] Total time: 1:34.297s
[INFO] Finished at: Tue Apr 21 16:03:51 SGT 2015
[INFO] Final Memory: 88M/210M
[INFO] ---------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.wvengen:proguard-maven-plugin:2.0.8:proguard (default) on project com.x.y: Execution default of goal com.github.wvengen:proguard-maven-plugin:2.0.8:proguard failed: java.io.IOException: Cannot run program "C:\Program Files (x86)\Java\jdk1.7.0_55\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long -> [Help 1]
Has anyone ever encountered this? If so, how did you solve the problem?
Note that I have actually seen this question and other related questions before deciding to ask but the answer by Brad Mace is not applicable to my case as the "CreateProcess error=206, The filename or extension is too long" is generated by Proguard and not by Javadoc. Initially, I think (correct me if I'm wrong) that either 1 of the 7 options given by espinchi or a variation of them might work but I'm not sure which one. Just to let you know my constraints in determining the solution:
I'm not sure if all of the classpaths in this particular plugin are
valid since this has been developed by someone else many, many years
ago so I don't think I can still contact the developer. This makes
me hesitant to reduce the classpaths for fear that it might actually
do more harm than good.
I cannot use the switch to "use IntelliJ" option since this problem occurred on the Windows command line when doing mvn install
and not in Eclipse IDE.
I think the other options are too tedious for me. I'm hoping there's a simpler solution.
For reference, below is the Proguard-related snippet from my pom file:
<build>
<plugins>
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<maxMemory>1024m</maxMemory>
<proguardInclude>${basedir}/proguard.conf</proguardInclude>
<libs>
<lib>${java.home}/lib/rt.jar</lib>
</libs>
<exclusions>
<exclusion>
<groupId>com.company.package</groupId>
</exclusion>
</exclusions>
</configuration>
</plugin>
</plugins>
</build>
If you have a huge list of dependencies the list of -libraryjars the resulting command line to execute ProGaurd could become too long. On Windows the error message could look like CreateProcess error=206, The filename or extension is too long.
<putLibraryJarsInTempDir>true</putLibraryJarsInTempDir>
in plugin configuration makes the plugin copy all the library jars to a single temporary directory and pass that directory as the only -libraryjars argument to ProGuard. Build performance will be a bit worse, but the command line will be much shorter.
for detailed information about proguard maven plugin usage please refer their here
The reason to that is that generally maven repo is in user’s directory and that path adds on for every jar on the ‘classpath’ which makes it big enough for windows to handle.
The solution is that you need to move your maven repo to a shorter path – say C:. To do that you will need to edit maven settings.xml and add a tag as shown in the image link below. Once you do this, you can run maven clean install. This should solve the issue.
Maven Issue
Somehow, for our case, the ff. steps eliminated the error:
Compare the dependencies in the component's pom.xml and the dependencies identified by proguard-maven-plugin. In our case, we noticed that proguard-maven-plugin identified some dependencies that are not really need by the component. In fact, these dependencies are not even specified in the component's pom.xml.
After performing Step 1, modify the component's pom.xml such that it will exclude the unnecessary dependencies that Proguard has identified (i.e., use the exclusion parameter). Below is a sample snippet:
<build>
<plugins>
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.0.10</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<maxMemory>1024m</maxMemory>
<proguardInclude>${basedir}/proguard.conf</proguardInclude>
<libs>
<lib>${java.home}/lib/rt.jar</lib>
<lib>${java.home}/lib/jce.jar</lib>
</libs>
<!-- For some reason, these components are included by the plugin even if they are not dependencies of SES components so we need to explicitly indicate to proguard-maven-plugin to exclude them. -->
<exclusions>
<exclusion>
<groupId>p2.eclipse-plugin</groupId>
<artifactId>org.apache.geronimo.specs.geronimo-jms_1.1_spec</artifactId>
</exclusion>
<!-- other exclusions here -->
</exclusions>
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-base</artifactId>
<version>5.2</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Apparently this issue was solved in newer versions of the plug-in:
https://github.com/wvengen/proguard-maven-plugin/issues/113
Use this newly added config option, solved our case:
<configuration>
<generateTemporaryConfigurationFile>true</generateTemporaryConfigurationFile>
</configuration>
I have solution with 5 projects:
00-PROJECT - Parent project for whole solution. Other projects are submodeles of this one.
01-INTERFACE - API description library for communications between client and server
02-SERVER - Server application that provides API
03-CLIENT - Client modules that communicate with server application
04-DESKTOP - Desktop application built using SWT GUI library. Communicates with server using client modules from 03-CLIENT.
While I develop this whole solution I need to have embedded 02-SERVER in 04-DESKTOP. This is needed to easy run and debug application in Eclipse IDE because both and client and server are under develop together.
But to deploy application to the client I need to build 02-SERVER and 04-DESKTOP separately. I found solution for prepare deployment .zip - it is maven-assembly-plugin. It assemblies all .jars, configuration files, jasper templates in one .zip (or folder). It works perfect. But one problem appeared when I tried to create deployment package of 04-DESKTOP for several platforms, at least these three: Windows 32bit, Windows 64bit, Linux 64bit (all are used in customer's organization).
One of solutions for 04-DESKTOP is profiles. Maven provide a powerful profiles system. But the problem was that you can run maven with one profile and there is no way to invoke maven for several profiles. The second think is wen I invoke maven to build packages for each profile using parent pom 02-SERVER is recompiled each time and I didn't like this solution.
The my main question was how prepare 5 packages (one server package and 4 desktop packages) with single command? e.g. invoke mvn package in parent project.
I searched for answer for a while. Here are similar questions on stackoverflow.com and answers, but I didn't found answer for my question. After some research and tries I found solution.
I just added 4 projects in solution for each platform I needed. So my solution now has 7 projects:
00-PROJECT
01-INTERFACE
02-SERVER
03-CLIENT
04-DESKTOP
04-DESKTOP-LINUX-x86
04-DESKTOP-LINUX-x64
04-DESKTOP-WIN32-x86
04-DESKTOP-WIN32-x64
There are no source codes in folders in these additional projects. But there is pom.xml in these projects. The build configuration points to 04-DESKTOP sources folder:
<build>
<sourceDirectory>../04-DESKTOP/src</sourceDirectory>
</build>
Because all these 4 projects are modules in main project I can't give them the same artifactId. But maven-jar-plugin by default creates jar with name equals to artifactId. So result jar file name is redefined in maven-jar-plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix></classpathPrefix>
<mainClass>net.cloudstock.desktop.app</mainClass>
</manifest>
</archive>
<finalName>net.cloudstock.desktop-${project.version}</finalName>
</configuration>
</plugin>
The whole pom.xml for one of additional projects is:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<!-- Information about parent project -->
<artifactId>net.cloudstock.system</artifactId>
<groupId>net.cloudstock</groupId>
<version>1.0.1</version>
</parent>
<artifactId>net.cloudstock.desktop.win32.x86</artifactId>
<name>Cloudstock Descktop frontend (Windows x86)</name>
<packaging>jar</packaging>
<properties>
<!-- Operation system where this app must run -->
<os>win32</os>
<!-- Processor architecture -->
<arch>x86</arch>
<!-- Variable to point sources to 04-DESKTOP/src folder -->
<desktop.root>../04-DESKTOP</desktop.root>
<!-- I am new in maven, so I can't comment this line -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<!-- Tell to the compiler where sources are -->
<sourceDirectory>${desktop.root}/src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix></classpathPrefix>
<mainClass>net.cloudstock.desktop.app</mainClass>
</manifest>
</archive>
<!-- Redefine result jar, because by default its name will be net.cloudstock.desktop.win32.x86-{VERSION}.jar -->
<finalName>net.cloudstock.desktop-${project.version}</finalName>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>${desktop.root}/assembly.xml</descriptor>
</descriptors>
<!-- the name of the zip archive with program that I send to the customer -->
<finalName>net.cloudstock.desktop-${os}-${arch}-${project.version}</finalName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<!-- SWT for Win x86. It differs for different OSes and processors -->
<dependency>
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt.win32.win32.x86</artifactId>
<version>4.3</version>
</dependency>
<!-- Other application deps. They are duplicated in all 04-DESKTOP* projects -->
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.1.0</version>
</dependency>
<dependency>
<groupId>net.cloudstock</groupId>
<artifactId>net.cloudstock.client</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>net.cloudstock</groupId>
<artifactId>net.cloudstock.interface</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.jface</groupId>
<artifactId>org.eclipse.jface</artifactId>
<version>3.8.0.v20120521-2329</version>
</dependency>
</dependencies>
</project>
The one thing in this schema is not enough nice is a hack in ${desktop.root}/assembly.xml
You can't tell to maven-assembly-plugin to include artifact jar in assembly because it includes jar with artifactId name. So I added one additional fileSet to include resulting jar from current project:
<fileSets>
<fileSet>
<directory>target</directory>
<outputDirectory>lib/</outputDirectory>
<includes>
<include>net.cloudstock.desktop-${project.version}.jar</include>
</includes>
</fileSet>
...
</fileSets>
An the end I added dependency tag in 04-DESCTOP/pom.xml to include 02-SERVER and four profiles witch are activated by os condition:
<profile>
<id>win-x86-debug</id>
<activation>
<activeByDefault>false</activeByDefault>
<os>
<family>Windows</family>
<arch>x86</arch>
</os>
</activation>
<dependencies>
<dependency>
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt.win32.win32.x86</artifactId>
<version>4.3</version>
</dependency>
</dependencies>
</profile>
Now I develop desktop application in 04-DESCTOP project in Eclipse. I can run and debug whole solution.
When I finish with current iteration and want to send application to the customer I build it using one command from parent project mvn package:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] Cloudstock System ..................................... SUCCESS [2.202s]
[INFO] Helper Library by Nicolai Budico ...................... SUCCESS [4.563s]
[INFO] Cloudstock Interface .................................. SUCCESS [2.925s]
[INFO] Cloudstock Server ..................................... SUCCESS [3.835s]
[INFO] Cloudstock Client Backend ............................. SUCCESS [1.120s]
[INFO] Cloudstock Descktop frontend (Windows x86) ............ SUCCESS [9.019s]
[INFO] Cloudstock Descktop frontend (Windows x64) ............ SUCCESS [5.530s]
[INFO] Cloudstock Descktop frontend (Linux x86) .............. SUCCESS [5.158s]
[INFO] Cloudstock Descktop frontend (Linux x64) .............. SUCCESS [4.998s]
[INFO] ------------------------------------------------------------------------
The last think that must be noticed in this solution is that You need to edit 5 pom's if something is changed in desktop application configuration.
Maybe this solution is wrong, maybe it is not so correct, but I am very happy with it. And I really hope this will be helpful for someone.
I have created a maven android project using this archetype. I want to integrate mirah source files inside my project. So I added the plugin mentioned here to my pom.xml. I setup the configuration section for the plugin to point the source directory to src/main/mirah.
But when I run mvn compile it only compiles the sources inside src/main/java. I have tried running it with mvn -X compile to try and debug the issue, but I can't find anything related to mirah or the mirah-maven-plugin there.
Using the archetype it created two projects - project and project-it (tests) , there is a pom.xml in the root directory as well as a pom.xml in project and project-it directories. I have tried the above configurations in both the root directory as well as in project's pom.xml.
I have come across this question related to using the build-helper plugin but I don't know if it will help in my case. Since my mirah plugin isn't getting called at all.
Is this the right way to do what I'm trying to do? Any help on the setup, or pointer to how to troubleshoot this would be much appreciated.
The relevant bit of my pom.xml
<plugin>
<groupId>org.mirah.maven</groupId>
<artifactId>maven-mirah-plugin</artifactId>
<version>1.0</version>
<configuration>
<sourceDirectory>src/main/mirah</sourceDirectory>
<outputDirectory>target/classes</outputDirectory>
<bytecode>true</bytecode>
<verbose>false</verbose>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals><goal>compile</goal></goals>
</execution>
</executions>
</plugin>
Edited as per answer below.
I have added the source directory using the build-helper plugin and I'm able to get the mirah sources to compile using mvn org.mirah.maven:maven-mirah-plugin:1.0:compile from the answer below. But mvn compile still only compiles the sources in src/main/java and not src/main/mirah.
For anyone interested in the output of mvn -X compile here is the pastie.
This page https://github.com/calavera/maven-mirah-plugin#readme says that the mirah plugin extends the default compiler plugin. So this would suggest that the build helper plugin would work for multiple source directories, if it works for the default compiler plugin.
Looking at the mirah plugin, you probably don't need to specify sourceDirectory and outputDirectory yourself, as it seems you're using the defaults.
The -X switch won't have any impact on the mirah plugin directly, as it doesn't do any tracing itself (above what the default compiler plugin does).
Can you show your -X output anyway to show that the mirah plugin isn't invoked?
Alternatively, you could build the mirah plugin yourself and add tracing. It doesn't seem a complicated plugin.
What happens when you try and invoke the plugin directly? E.g.
mvn org.mirah.maven:maven-mirah-plugin:1.0:compile
EDIT:
Tried it myself and this works for me (by 'works' I mean the plugin gets invoked - my build actually fails).
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>temp</groupId>
<artifactId>temp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.mirah.maven</groupId>
<artifactId>maven-mirah-plugin</artifactId>
<version>1.0</version>
<configuration>
<bytecode>true</bytecode>
<verbose>true</verbose>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
With this output:
D:\dev\workspaces\3.6\temp>mvn compile
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - temp:temp:jar:0.0.1-SNAPSHOT
[INFO] task-segment: [compile]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [mirah:compile {execution: default}]
[INFO] No sources to compile
Parsing...
D:\dev\workspaces\3.6\temp\src\main\mirah/test.mirah
Inferring types...
* [Mirah::Typer] Learned local type under #<Mirah::AST::StaticScope:0xbc5245> : a = Type(int)
... ETC ...
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unknown error - Unknown Error (20047) - D:\dev\workspaces\3.6\temp\target\classes\D:
I don't know what the error means as I'm not a mirah user.
You have usage: findbugs-maven-plugin
<project>
[...]
<reporting>
[...]
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<xmlOutput>true|false</xmlOutput>
<xmlOutputDirectory>directory location of findbugs xdoc xml report</xmlOutputDirectory>
<threshold>High|Normal|Low|Exp|Ignore</threshold>
<effort>Min|Default|Max</effort>
<excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
<includeFilterFile>findbugs-include.xml</includeFilterFile>
<visitors>FindDeadLocalStores,UnreadFields</visitors>
<omitVisitors>FindDeadLocalStores,UnreadFields</omitVisitors>
<onlyAnalyze>org.codehaus.mojo.findbugs.*</onlyAnalyze>
<pluginList>/libs/fb-contrib/fb-contrib-2.8.0.jar</pluginList>
<debug>true|false</debug>
<relaxed>true|false</relaxed>
<findbugsXmlOutput>true|false</findbugsXmlOutput>
<findbugsXmlOutputDirectory>directory location of findbugs legact xml format report</findbugsXmlOutputDirectory>
</configuration>
</plugin>
[...]
</reporting>
[...]
</project>
But once:
mvn site
I get:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
GroupId: org.codehaus.mojo
ArtifactId: findbugs-maven-plugin
Version: 1.2.1
Reason: Unable to download the artifact from any repository
org.codehaus.mojo:findbugs-maven-plugin:pom:1.2.1
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
Do you know why? What should I do?
Looking at the repository, your version should be 1.2, not 1.2.1
Also, your configuration is wrong, you need to choose some of the options. So it should look like:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<threshold>High</threshold>
<effort>Default</effort>
</configuration>
</plugin>
try that:
<version>1.2</version>
http://repo2.maven.org/maven2/org/codehaus/mojo/findbugs-maven-plugin/
Seems like they did a simple copy/paste error.
The report will be in target/site. Look at the file index.html in a browser, than look for project reports, then findbugs report.
As part of your parent project structure place site.xml into parent-project/src/site:
|--- src
|---site
|---site.xml
An example site.xml from "Better Builds with Maven" (a free book available online) should get you started.
Once site.xml is created, execute mvn site from the parent project directory. It will pick up your reporting settings including the firebug report. Once the site is built, each child project will have directory /target/site, which contains index.html with a link to project reports. The project reports should contain firebug reports.