specifying phase?

27 views
Skip to first unread message

Kevin Clarke

unread,
Apr 18, 2013, 1:30:39 AM4/18/13
to cmake-maven-...@googlegroups.com
I don't think this is necessarily a cmake-maven-plugin question, but I've been using version 2.8.10.2-b2 of the plugin and decided to check out the latest version (2.8.10.2-b6-SNAPSHOT) from Google Code.  After a bit of digging around, I realized my compile goal wasn't firing unless I added <phase>compile</phase> to my 'execution' element.  This wasn't required with the 2.8.10.2-b2 version (I didn't have the 'phase' element, but the action was still triggered).  This also is only the case with the compile mojo... the generate mojo is triggered (still) without adding a 'phase' element.

I looked through the commits between the two versions and don't really see a modification that looks like an obvious cause of this change.  Does anyone know why I have to specify phase with the most recent version while I don't with the earlier version?  Is it related to the -SNAPSHOT designation?

Thanks!
Kevin

cowwoc

unread,
Apr 18, 2013, 9:09:59 AM4/18/13
to cmake-maven-...@googlegroups.com

That's odd. I don't see any relevant changes between the two
versions either.

Gili
> --
> You received this message because you are subscribed to the Google
> Groups "cmake-maven-project-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to cmake-maven-projec...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Kevin S. Clarke

unread,
Apr 18, 2013, 10:39:59 AM4/18/13
to cmake-maven-...@googlegroups.com
Ah, in the clear light of day (and with a bit more testing), I think I've discovered the problem...  In the CompileMojo (since the release I was using), there were <p> tags added around the goal and phase annotations (see below).  This seems to be what "breaks" it... causing the goal and phase not to be seen.  When I build the cmake-maven-plugin with them I have to manually add a <phase>compile</phase> to the execution in my project's pom/configuration; when I build without the <p> tags, Maven detects it should execute CMake in the compile phase and I don't have to have the phase in my pom.

/**
 * Goal which compiles project files generated by CMake.
 * <p/>
 * @goal compile
 * @phase compile
 * <p/>
 * @author Gili Tzabari
 */

GenerateMojo wasn't affected because it doesn't have the <p> tags.

Kevin



To unsubscribe from this group and stop receiving emails from it, send an email to cmake-maven-project-users+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to a topic in the Google Groups "cmake-maven-project-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cmake-maven-project-users/pQ7F0of9cxg/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to cmake-maven-project-users+unsub...@googlegroups.com.

Kevin S. Clarke

unread,
Apr 18, 2013, 10:42:28 AM4/18/13
to cmake-maven-...@googlegroups.com
Just for the record, this is my setup (in case it's a Java/Maven quirk):

kevin@POW-L-DEV103:~/Workspace/cmake-maven-project$ java -version
java version "1.7.0_15"
OpenJDK Runtime Environment (IcedTea7 2.3.7) (7u15-2.3.7-0ubuntu1~12.04.1)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

kevin@POW-L-DEV103:~/Workspace/cmake-maven-project$ mvn -version
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.7.0_15, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-40-generic", arch: "amd64", family: "unix"



cowwoc

unread,
Apr 18, 2013, 11:17:09 AM4/18/13
to cmake-maven-...@googlegroups.com

    Wow, Maven is terrible. Can you please investigate whether the first, last or both <p/> are causing a problem? If you are feeling extra generous, can you file a bug report against Maven and send me the bug report link?

    (As you can tell, I am extremely short of time these days. Sorry for that...)

Thanks,
Gili


On 18/04/2013 10:39 AM, Kevin S. Clarke wrote:
Ah, in the clear light of day (and with a bit more testing), I think I've discovered the problem...  In the CompileMojo (since the release I was using), there were <p> tags added around the goal and phase annotations (see below).  This seems to be what "breaks" it... causing the goal and phase not to be seen.  When I build the cmake-maven-plugin with them I have to manually add a <phase>compile</phase> to the execution in my project's pom/configuration; when I build without the <p> tags, Maven detects it should execute CMake in the compile phase and I don't have to have the phase in my pom.

/**
 * Goal which compiles project files generated by CMake.
 * <p/>
 * @goal compile
 * @phase compile
 * <p/>
 * @author Gili Tzabari
 */

GenerateMojo wasn't affected because it doesn't have the <p> tags.

Kevin

On Thu, Apr 18, 2013 at 9:09 AM, cowwoc <cow...@bbs.darktech.org> wrote:

    That's odd. I don't see any relevant changes between the two versions either.

Gili

On 18/04/2013 1:30 AM, Kevin Clarke wrote:
I don't think this is necessarily a cmake-maven-plugin question, but I've been using version 2.8.10.2-b2 of the plugin and decided to check out the latest version (2.8.10.2-b6-SNAPSHOT) from Google Code.  After a bit of digging around, I realized my compile goal wasn't firing unless I added <phase>compile</phase> to my 'execution' element.  This wasn't required with the 2.8.10.2-b2 version (I didn't have the 'phase' element, but the action was still triggered).  This also is only the case with the compile mojo... the generate mojo is triggered (still) without adding a 'phase' element.

I looked through the commits between the two versions and don't really see a modification that looks like an obvious cause of this change.  Does anyone know why I have to specify phase with the most recent version while I don't with the earlier version?  Is it related to the -SNAPSHOT designation?

Thanks!
Kevin

--
You received this message because you are subscribed to the Google Groups "cmake-maven-project-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cmake-maven-projec...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to a topic in the Google Groups "cmake-maven-project-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cmake-maven-project-users/pQ7F0of9cxg/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to cmake-maven-projec...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups "cmake-maven-project-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cmake-maven-projec...@googlegroups.com.

Kevin S. Clarke

unread,
Apr 18, 2013, 11:36:32 AM4/18/13
to cmake-maven-...@googlegroups.com
Sure, will do.

Kevin

Kevin S. Clarke

unread,
Apr 18, 2013, 3:48:30 PM4/18/13
to cmake-maven-...@googlegroups.com
So it seems it's the <p/> between the tags.  The <p/> before the tags doesn't cause a problem.  This works fine:

/**
 * Goal which compiles project files generated by CMake.
 * <p/>
 * @goal compile
 * @phase compile
 *
 * @author Gili Tzabari
 */

It seems they are moving folks towards Java 5 style annotations:


I may or may not take the time to work up a proper bug report (since they might just say, "Use the newer syntax").  We'll see how my free time goes...

Kevin




On Thu, Apr 18, 2013 at 11:17 AM, cowwoc <cow...@bbs.darktech.org> wrote:
Reply all
Reply to author
Forward
0 new messages