You need to specify a list of directories to include classes from to
translate, which can not be specified on the command-line. You need
to configure the plugin in your pom, something like what is explained
here:
http://mojo.codehaus.org/retrotranslator-maven-plugin/usage.html
You don't have to bind the execution to a phase, you can simple omit
the executions and defined a top-level configuration element which
sets up the proper settings for the plugin and then run it from the
command-line.
I usually setup the plugin to translate all of the classes in a
module and then attache a new artifact with the translated jars,
something like:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>retrotranslator-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>translate</goal>
</goals>
<configuration>
<verify>false</verify>
<failonwarning>true</failonwarning>
<lazy>true</lazy>
<verbose>false</verbose>
<destjar>${pom.basedir}/target/${pom.artifactId}-
${pom.version}-retro.jar</destjar>
<includes>
<include>
<directory>${pom.basedir}/target</
directory>
<pattern>${pom.artifactId}-$
{pom.version}.jar</pattern>
</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${pom.basedir}/target/$
{pom.artifactId}-${pom.version}-retro.jar</file>
<type>jar</type>
<classifier>retro</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
--jason
On Jan 17, 2007, at 6:09 AM, Sebastien Pennec wrote:
Hi all,
Is anybody able to use the retrotranslator plugin by calling it
directly, that is by issuing mvn compile retrotranslator:translate,
from a parent project directory?
On my environment, I keep getting the following error:
[0] inside the definition for plugin: 'retrotranslator-maven-
plugin'specify the following:
<configuration>
...
<includes>VALUE</includes>
</configuration>.
If I link the plugin to a phase, like the process-classes phase,
then it works fine, but I'd like to launch it directly, and not
having maven launch it automatically.
Why should I want to do that? Well, the verify phase of the
translation requires the user to set a variable to reach the rj.jar
file. I'd like my build to be able to run even if the user has not
set this variable.
Any help would be highly appreciated...
Sébastien
Sebastien Pennec wrote:
Hello,
I've tried today the Retrotranslator plugin and it looks like it's
exactly what I've been looking for :)
I have two questions about its use.
First, I had to declare it in all my child project's pom.xml
files. If I declare it in the parent pom, like I'd prefer to do,
it searches for a /target/classes directory in the parent
directory, doesn't find it and claims that there is no specified
source directory. I tried to use substitution variables, but
couldn't make it work. Is there a way to declare the plugin only
in the parent pom?
My second question is about the verification process. On the
website, there is the following text:
The classpath to use for verification including rt.jar, jce.jar,
jsse.jar (from JRE 1.4). The retrotranslator-runtime-n.n.n.jar,
and backport-util-concurrent.jar are included by default, they are
not required to be defined here.
My understanding of the last sentence is that there is no need to
declare the Retrotranslator runtime jar as a dependency, since it
is included by default. Unfortunately, until now, I've had to
declare a <dependency> element in my parent pom.xml, or the
verification process does not work. Do I really have to include
the runtime jar as a dependency?
Could it be possible to add it as a plugin dependency instead? I
mean, add a <dependencies> and <dependency> elements in the
<plugin> element.
Thanks for making this plugin!
Sébastien
--
Sébastien Pennec
[EMAIL PROTECTED]
Logback: The reliable, generic, fast and flexible logging framework
for Java.
http://logback.qos.ch/
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email