Discussion:
Source directory for the maven-apt-plugin plugin
Stephane-3
2013-04-25 14:07:56 UTC
Permalink
I'm trying to use a plugin that should generate some source code.

But when I run the Maven build with the mvn generate-sources command, it
gives the following error:

[ERROR] Failed to execute goal
com.mysema.maven:maven-apt-plugin:1.0.4:process (default) on project
learnintouch: basedir
/home/stephane/dev/java/projects/learnintouch/src/main/java does not exist

Here is the plugin configuration:

<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>maven-apt-plugin</artifactId>
<version>1.0.4</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>process</goal>
</goals>
<configuration>

<processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>

My parent project sits in the /home/stephane/dev/java/projects/learnintouch
directory.

There is only one child module, in the
/home/stephane/dev/java/projects/learnintouch/core directory.

The two pom.xml files are:

/home/stephane/dev/java/projects/learnintouch/pom.xml
/home/stephane/dev/java/projects/learnintouch/core/pom.xml

The plugin configuration is sitting the
/home/stephane/dev/java/projects/learnintouch/pom.xml file.

I'm then trying to specify a source directory, with the following:

<sourceDirectory>${basedir}/core/src/main/java/com/thalasoft/learnintouch/core/jpa/domain</sourceDirectory>

But it gives the error:

[ERROR] Failed to execute goal
com.mysema.maven:maven-apt-plugin:1.0.4:process (default) on project
learnintouch-core: basedir
/home/stephane/dev/java/projects/learnintouch/core/core/src/main/java/com/thalasoft/learnintouch/core/jpa/domain
does not exist

We can see in the above error the core/core/ doubling of the directory name.

If I then remove the core/ directory from the configuration as in:

<sourceDirectory>${basedir}/src/main/java/com/thalasoft/learnintouch/core/jpa/domain</sourceDirectory>

[ERROR] Failed to execute goal
com.mysema.maven:maven-apt-plugin:1.0.4:process (default) on project
learnintouch-core: basedir
/home/stephane/dev/java/projects/learnintouch/core/core/src/main/java/com/thalasoft/learnintouch/core/jpa/domain
does not exist

then, not one core/ directory, but two core/core/ directories are removed
in the error message.

Puzzling...



--
View this message in context: http://maven.40175.n5.nabble.com/Source-directory-for-the-maven-apt-plugin-plugin-tp5754338.html
Sent from the Maven - Users mailing list archive at Nabble.com.
Robert Scholte
2013-04-25 17:01:18 UTC
Permalink
Hi,

this plugin is not written by the Maven team.
Either contact the developer of this plugin or try the apt-maven-plugin
from the Mojo team[1]

Robert

[1] http://mojo.codehaus.org/apt-maven-plugin/

Op Thu, 25 Apr 2013 16:07:56 +0200 schreef Stephane-3
Post by Stephane-3
I'm trying to use a plugin that should generate some source code.
But when I run the Maven build with the mvn generate-sources command, it
[ERROR] Failed to execute goal
com.mysema.maven:maven-apt-plugin:1.0.4:process (default) on project
learnintouch: basedir
/home/stephane/dev/java/projects/learnintouch/src/main/java does not exist
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>maven-apt-plugin</artifactId>
<version>1.0.4</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>process</goal>
</goals>
<configuration>
<processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>
My parent project sits in the
/home/stephane/dev/java/projects/learnintouch
directory.
There is only one child module, in the
/home/stephane/dev/java/projects/learnintouch/core directory.
/home/stephane/dev/java/projects/learnintouch/pom.xml
/home/stephane/dev/java/projects/learnintouch/core/pom.xml
The plugin configuration is sitting the
/home/stephane/dev/java/projects/learnintouch/pom.xml file.
<sourceDirectory>${basedir}/core/src/main/java/com/thalasoft/learnintouch/core/jpa/domain</sourceDirectory>
[ERROR] Failed to execute goal
com.mysema.maven:maven-apt-plugin:1.0.4:process (default) on project
learnintouch-core: basedir
/home/stephane/dev/java/projects/learnintouch/core/core/src/main/java/com/thalasoft/learnintouch/core/jpa/domain
does not exist
We can see in the above error the core/core/ doubling of the directory name.
<sourceDirectory>${basedir}/src/main/java/com/thalasoft/learnintouch/core/jpa/domain</sourceDirectory>
[ERROR] Failed to execute goal
com.mysema.maven:maven-apt-plugin:1.0.4:process (default) on project
learnintouch-core: basedir
/home/stephane/dev/java/projects/learnintouch/core/core/src/main/java/com/thalasoft/learnintouch/core/jpa/domain
does not exist
then, not one core/ directory, but two core/core/ directories are removed
in the error message.
Puzzling...
--
http://maven.40175.n5.nabble.com/Source-directory-for-the-maven-apt-plugin-plugin-tp5754338.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
Baptiste MATHUS
2013-04-26 06:47:13 UTC
Permalink
Le 25 avr. 2013 16:26, "Stephane-3" <***@yahoo.se> a écrit :
[Snip]
<sourceDirectory>${basedir}/core/src/main/java/com/thalasoft/learnintouch/core/jpa/domain</sourceDirectory>

Why do you define sourceDirectory? Its default value is already
${basedir}/src/main/java

-- Baptiste
Stephane-3
2013-04-26 07:44:40 UTC
Permalink
Hello,

Yes, but then my source directory is not found, because it sits in the core/ child module as I explained in my original post.

Kind Regards,

Stephane



________________________________
De : Baptiste MATHUS [via Maven] <ml-node+***@n5.nabble.com>
À : Stephane-3 <***@yahoo.se>
Envoyé le : Vendredi 26 avril 2013 8h48
Objet : Re: Source directory for the maven-apt-plugin plugin



Le 25 avr. 2013 16:26, "Stephane-3" <[hidden email]> a écrit :
[Snip]
<sourceDirectory>${basedir}/core/src/main/java/com/thalasoft/learnintouch/core/jpa/domain</sourceDirectory>

Why do you define sourceDirectory? Its default value is already
${basedir}/src/main/java

-- Baptiste


________________________________

If you reply to this email, your message will be added to the discussion below:http://maven.40175.n5.nabble.com/Source-directory-for-the-maven-apt-plugin-plugin-tp5754338p5754382.html
To unsubscribe from Source directory for the maven-apt-plugin plugin, click here.
NAML



--
View this message in context: http://maven.40175.n5.nabble.com/Source-directory-for-the-maven-apt-plugin-plugin-tp5754338p5754383.html
Sent from the Maven - Users mailing list archive at Nabble.com.
Baptiste MATHUS
2013-04-26 08:14:56 UTC
Permalink
OK, I think I misread your first message.
So, it seems you're trying to run the plugin from the parent to access
sources from a child module.

If so, then you should know it's a bad idea. Modules should generally be
independent in their execution.
If that plugin is needed in your core module, then configure it just in
that plugin.

Here, the first error is related to the fact the plugin is trying to
execute for the parent pom, but there's logically no sources. So the
execution stops there.
Then I think the second one is the core module execution inheriting the
parent configuration, but for this module ${basedir} is already containing
core, so there's core twice.

Cheers
Post by Stephane-3
Hello,
Yes, but then my source directory is not found, because it sits in the
core/ child module as I explained in my original post.
Kind Regards,
Stephane
________________________________
Envoyé le : Vendredi 26 avril 2013 8h48
Objet : Re: Source directory for the maven-apt-plugin plugin
[Snip]
<sourceDirectory>${basedir}/core/src/main/java/com/thalasoft/learnintouch/core/jpa/domain</sourceDirectory>
Why do you define sourceDirectory? Its default value is already
${basedir}/src/main/java
-- Baptiste
________________________________
If you reply to this email, your message will be added to the discussion
http://maven.40175.n5.nabble.com/Source-directory-for-the-maven-apt-plugin-plugin-tp5754338p5754382.html
To unsubscribe from Source directory for the maven-apt-plugin plugin, click here.
NAML
--
http://maven.40175.n5.nabble.com/Source-directory-for-the-maven-apt-plugin-plugin-tp5754338p5754383.html
Sent from the Maven - Users mailing list archive at Nabble.com.
--
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor ! nbsp;!
Stephane-3
2013-04-29 19:20:59 UTC
Permalink
Thanks Baptiste, I got it. Also, my initial post was a bit inaccurate as it
lacked the <outputDirectory>target/generated-sources</outputDirectory>
element.

The following plugin

<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>maven-apt-plugin</artifactId>
<version>1.0.4</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources</outputDirectory>

<processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>

in the child module pom.xml file does the job now.

Cheers,




--
View this message in context: http://maven.40175.n5.nabble.com/Source-directory-for-the-maven-apt-plugin-plugin-tp5754338p5754590.html
Sent from the Maven - Users mailing list archive at Nabble.com.

Loading...