You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stephane-3 <mi...@yahoo.se> on 2013/04/25 16:07:56 UTC

Source directory for the maven-apt-plugin plugin

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.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Source directory for the maven-apt-plugin plugin

Posted by Robert Scholte <rf...@apache.org>.
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  
<mi...@yahoo.se>:

> 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.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Source directory for the maven-apt-plugin plugin

Posted by Stephane-3 <mi...@yahoo.se>.
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.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Source directory for the maven-apt-plugin plugin

Posted by Baptiste MATHUS <ml...@batmat.net>.
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


2013/4/26 Stephane-3 <mi...@yahoo.se>

> 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...@n5.nabble.com>
> À : Stephane-3 <mi...@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]
> > 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>
>
> 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 <Batmat> MATHUS - http://batmat.net
> Sauvez un arbre,
> Mangez un castor ! nbsp;!
>

Re: Source directory for the maven-apt-plugin plugin

Posted by Stephane-3 <mi...@yahoo.se>.
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...@n5.nabble.com>
À : Stephane-3 <mi...@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] 
> 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> 

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.

Re: Source directory for the maven-apt-plugin plugin

Posted by Baptiste MATHUS <ml...@batmat.net>.
Le 25 avr. 2013 16:26, "Stephane-3" <mi...@yahoo.se> a écrit :
[Snip]
> 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>

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

-- Baptiste