Hrm... folks this seems to be a common problem... of folks not understanding how Maven configuration works.

In this pom you set up an execution, which binds the "translate" goal to a phase of the maven build. And really, the configuration is fine...

The problem is that you are not running mvn in a phased build, but you are running the translate goal directly, as you mention you use:

    mvn retrotranslator:translate

This *will not* pick up *any* of the configuration in that execution which you have configured.

In most cases I would not recommend using the goal in this fashion, though for some reason people keep wanting to run the goals explicitly instead of using the build lifecycle as one might have expected/assumed.

So, just use a phase, like install or package:

    mvn install

This should work with the given configuration... and really I recommend that for 90% of the times you use mvn that you probably want to use a phase anyways, so that all of the plugin executions are invoked in the correct order with the correct configuration.

I will probably update the site docs to explain to people to use `mvn install` when using the example poms. I guess I just take that knowledge for granted...

--jason


On Mar 19, 2007, at 6:52 AM, Gohan wrote:


Hi,

I've created a simple project just to try out Retrotranslate 1.0- alpha-2 but I can't get it working. However I try to configure the includes I get the
same error, "Source not set.".

If I just copy and paste the example code found on
http://mojo.codehaus.org/retrotranslator-maven-plugin/examples/ general-translation.html
I end up with a pom like:

<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/maven-v4_0_0.xsd";>
        <modelVersion>4.0.0</modelVersion>
        <groupId>se.jayway</groupId>
        <artifactId>Java5to4</artifactId>
        <packaging>jar</packaging>
        <version>1.0-SNAPSHOT</version>
        <name>Java5to4</name>
        <url>http://maven.apache.org</url>
        <build>
                <plugins>
                        <plugin>
                                <groupId>org.codehaus.mojo</groupId>
                                
<artifactId>retrotranslator-maven-plugin</artifactId>
                                <executions>
                                        <execution>
                                                <phase>process-classes</phase>
                                                <goals>
                                                        <goal>translate</goal>
                                                </goals>
                                                <configuration>
                                                        <filesets>
                                                                <fileset>
                                                                        
<directory>
                                                                                
${project.build.outputDirectory}
                                                                        
</directory>
                                                                        
<includes>
                                                                                
<include>**/*.class</include>
                                                                        
</includes>
                                                                </fileset>
                                                        </filesets>
                                                </configuration>
                                        </execution>
                                </executions>
                        </plugin>
                </plugins>
        </build>
        <dependencies>
                <dependency>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                        <version>3.8.1</version>
                        <scope>test</scope>
                </dependency>
        </dependencies>
</project>

I read in a thread here somewhere that
<directory>${project.build.outputDirectory}</directory> should be replaced to <basedir>${pom.basedir}/target/classes</basedir> but I still get the same
error when I execute "mvn retrotranslator:translate".

Thanks


--
View this message in context: http://www.nabble.com/Retrotranslate- source-not-set-error-tf3427167.html#a9552395
Sent from the mojo - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
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

Reply via email to