karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: Features maven plugin forces build phases to execute twice
Date Thu, 14 Jul 2011 16:16:59 GMT
Hi,

I think I fixed this in the 3.0 karaf plugin when I noticed it.  It's caused by this annotation
in the mojo:

 * @execute phase="compile"

which (as I learned by bugging people on maven irc rather than from the documentation) causes
maven to fork off a new lifecycle and execute it through the compile phase.  I think removing
that annotation from all the mojos will fix this.  Maybe its needed for some mojos but I doubt
it.

thanks
david jencks


On Jul 14, 2011, at 6:54 AM, Zhemzhitsky Sergey wrote:

> Hi JB,
> 
> Here is the POM
> 
> <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/xsd/maven-4.0.0.xsd">
>    <modelVersion>4.0.0</modelVersion>
> 
> 	<parent>
> 		<groupId>org.sample</groupId>
> 		<artifactId>org.sample</artifactId>
> 		<version>1.0.7-SNAPSHOT</version>
> 	</parent>
> 
>    <artifactId>org.sample</artifactId>
> 	<name>${project.artifactId}</name>
>    <packaging>bundle</packaging>
> 
>    <properties>
>        <jaxb.src.dir>${project.build.directory}/generated-sources/xjc</jaxb.src.dir>
>    </properties>
> 
>    <build>
>        <resources>
>            <resource>
>                <directory>src/main/resources</directory>
>                <excludes>
>                    <exclude>**/*.xjb</exclude>
>                </excludes>
>            </resource>
>            <resource>
>                <directory>src/main/resources</directory>
>                <filtering>true</filtering>
>                <includes>
>                    <include>features.xml</include>
>                </includes>
>            </resource>
>        </resources>
>        <plugins>
>            <plugin>
>                <groupId>org.apache.felix</groupId>
>                <artifactId>maven-bundle-plugin</artifactId>
>                <configuration>
>                    <instructions>
>                        <Export-Package>!*</Export-Package>
>                        <Import-Package>
>                            <!-- Required by CXF -->
>                            org.springframework.beans,
>                            org.springframework.beans.factory.config,
>                            org.springframework.beans.factory.support,
>                            <!-- Required by CXF -->
>                            *
>                        </Import-Package>
>                        <DynamicImport-Package>
>                            org.apache.cxf.*
>                        </DynamicImport-Package>
>                        <Exclude-Resource>
>                            src/main/resources/features.xml
>                        </Exclude-Resource>
>                        <Bundle-Name>${project.artifactId}</Bundle-Name>
>                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
>                        <_versionpolicy>[$(version;===;$(@)),$(version;+;$(@)))</_versionpolicy>
>                        <_provider-policy>[$(version;===;$(@)),$(version;=+;$(@)))</_provider-policy>
>                    </instructions>
>                </configuration>
>            </plugin>
>            <plugin>
>                <groupId>org.jvnet.jaxb2.maven2</groupId>
>                <artifactId>maven-jaxb2-plugin</artifactId>
>                <executions>
>                    <execution>
>                        <id>generate-jaxb-classes</id>
>                        <goals>
>                            <goal>generate</goal>
>                        </goals>
>                        <phase>generate-sources</phase>
>                        <configuration>
>                            <schemaIncludes>
>                                <include>**/schema.xsd</include>
>                            </schemaIncludes>
>                            <bindingIncludes>
>                                <include>**/schema.xjb</include>
>                            </bindingIncludes>
>                            <generateDirectory>${src.generated.dir}</generateDirectory>
>                            <verbose>true</verbose>
>                            <extension>true</extension>
>                            <episode>false</episode>
>                            <args>
>                                <arg>-Xannotate</arg>
>                                <arg>-Xinject-code</arg>
>                            </args>
>                            <plugins>
>                                <plugin>
>                                    <groupId>org.jvnet.jaxb2_commons</groupId>
>                                    <artifactId>jaxb2-basics</artifactId>
>                                </plugin>
>                                <plugin>
>                                    <groupId>org.jvnet.jaxb2_commons</groupId>
>                                    <artifactId>jaxb2-basics-annotate</artifactId>
>                                </plugin>
>                            </plugins>
>                        </configuration>
>                    </execution>
>                </executions>
>            </plugin>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-install-plugin</artifactId>
>                <executions>
>                    <execution>
>                        <id>install-features</id>
>                        <phase>package</phase>
>                        <goals>
>                            <goal>install-file</goal>
>                        </goals>
>                        <configuration>
>                            <file>${project.build.outputDirectory}/features.xml</file>
>                            <groupId>${project.groupId}</groupId>
>                            <artifactId>${project.artifactId}</artifactId>
>                            <version>${project.version}</version>
>                            <packaging>xml</packaging>
>                            <classifier>features</classifier>
>                        </configuration>
>                    </execution>
>                </executions>
>            </plugin>
>            <plugin>
>                <groupId>org.apache.karaf.tooling</groupId>
>                <artifactId>features-maven-plugin</artifactId>
>                <executions>
>                    <execution>
>                        <id>make-repo</id>
>                        <phase>install</phase>
>                        <goals>
>                            <goal>add-features-to-repo</goal>
>                        </goals>
>                        <configuration>
>                            <descriptors>
>                                <descriptor>mvn:org.apache.servicemix/apache-servicemix/${servicemix.version}/xml/camel-features</descriptor>
>                                <descriptor>mvn:org.apache.servicemix/apache-servicemix/${servicemix.version}/xml/features</descriptor>
>                                <descriptor>mvn:org.apache.servicemix.nmr/apache-servicemix-nmr/${nmr.version}/xml/features</descriptor>
>                                <descriptor>mvn:org.apache.karaf/apache-karaf/${karaf.version}/xml/features</descriptor>
>                                <descriptor>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</descriptor>
>                            </descriptors>
>                            <features>
>                                <feature>${project.artifactId}</feature>
>                            </features>
>                            <addTransitiveFeatures>true</addTransitiveFeatures>
>                            <includeMvnBasedDescriptors>true</includeMvnBasedDescriptors>
>                            <failOnArtifactResolutionError>false</failOnArtifactResolutionError>
>                            <skipNonMavenProtocols>true</skipNonMavenProtocols>
>                            <repository>${project.build.directory}/repo</repository>
>                        </configuration>
>                    </execution>
>                </executions>
>            </plugin>
>        </plugins>
>    </build>
> 
>    <dependencies>
>        <!-- CXF -->
>        <dependency>
>            <groupId>org.apache.cxf</groupId>
>            <artifactId>cxf-bundle</artifactId>
>            <scope>provided</scope>
>        </dependency>
>        <!-- CXF -->
> 
>        <!-- Camel -->
>        <dependency>
>            <groupId>org.apache.camel</groupId>
>            <artifactId>camel-core</artifactId>
>            <scope>provided</scope>
>        </dependency>
>        <dependency>
>            <groupId>org.apache.camel</groupId>
>            <artifactId>camel-spring</artifactId>
>            <scope>provided</scope>
>        </dependency>
>        <dependency>
>            <groupId>org.apache.camel</groupId>
>            <artifactId>camel-groovy</artifactId>
>            <scope>provided</scope>
>        </dependency>
>        <dependency>
>            <groupId>org.apache.camel</groupId>
>            <artifactId>camel-cxf</artifactId>
>            <scope>provided</scope>
>        </dependency>
>        <!-- Camel -->
> 
>        <!-- Logging -->
>        <dependency>
>            <groupId>org.slf4j</groupId>
>            <artifactId>slf4j-api</artifactId>
>            <scope>provided</scope>
>        </dependency>
>        <dependency>
>            <groupId>org.slf4j</groupId>
>            <artifactId>slf4j-log4j12</artifactId>
>            <scope>test</scope>
>        </dependency>
>        <dependency>
>            <groupId>log4j</groupId>
>            <artifactId>log4j</artifactId>
>            <scope>test</scope>
>        </dependency>
>        <!-- Logging -->
> 
>        <!-- JAXB -->
>        <dependency>
>            <groupId>org.apache.servicemix.specs</groupId>
>            <artifactId>org.apache.servicemix.specs.jaxb-api-2.2</artifactId>
>            <scope>provided</scope>
>        </dependency>
>        <dependency>
>            <groupId>org.apache.servicemix.bundles</groupId>
>            <artifactId>org.apache.servicemix.bundles.jaxb-impl</artifactId>
>            <scope>provided</scope>
>        </dependency>
>        <!-- JAXB -->
> 
>    </dependencies>
> 
> </project>
> 
> Best Regards,
> Sergey Zhemzhitsky
> Information Technology Division
> Troika Dialog, 4, Romanov lane, Moscow 125009, Russia
> Phone. +7 495 2580500 ext. 1246
> 
> 
> -----Original Message-----
> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
> Sent: Thursday, July 14, 2011 3:44 PM
> To: user@karaf.apache.org
> Subject: Re: Features maven plugin forces build phases to execute twice
> 
> Hi Sergey,
> 
> could you provide your POM where you execute features-maven-plugin ?
> 
> Regards
> JB
> 
> On 07/14/2011 01:05 PM, Zhemzhitsky Sergey wrote:
>> Hi there,
>> 
>> I have the following problem: The features-maven-plugin 2.1.3 forces 
>> build phases till the compile phase to execute twice.
>> 
>> I have also tried to use features-maven-plugin 2.2.2 but behavior is 
>> the same.
>> 
>> Could you suggest how to fix this issue?
>> 
>> Here is a brief maven build log:
>> 
>> [INFO] --- build-helper-maven-plugin:1.5:parse-version (parse-version) 
>> @ ---
>> 
>> [INFO]
>> 
>> [INFO] --- maven-jaxb2-plugin:0.8.0:generate (generate-jaxb-classes) @ 
>> ---
>> 
>> [INFO] Started execution.
>> 
>> [INFO] ---
>> 
>> [INFO] --- maven-antrun-plugin:1.5:run (default) @ ---
>> 
>> [INFO] Executing tasks
>> 
>> main:
>> 
>> [move] Moving 10 files to
>> C:\workspace\projects\myproj\trunk\provider\http\target\generated-sour
>> ces\xjc.bak
>> 
>> [copy] Copying 10 files to
>> C:\workspace\projects\myproj\trunk\provider\http\target\generated-sour
>> ces\xjc
>> 
>> [delete] Deleting directory
>> C:\workspace\projects\myproj\trunk\provider\http\target\generated-sour
>> ces\xjc.bak
>> 
>> [INFO] Executed tasks
>> 
>> [INFO]
>> 
>> [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ 
>> ---
>> 
>> [INFO]
>> 
>> [INFO] --- maven-compiler-plugin:2.3.1:compile (default-compile) @ ---
>> 
>> [INFO] Compiling 17 source files to
>> 
>> [INFO]
>> 
>> [INFO] --- maven-resources-plugin:2.5:testResources
>> (default-testResources) @ ---
>> 
>> [INFO] Copying 0 resource
>> 
>> [INFO]
>> 
>> [INFO] --- maven-compiler-plugin:2.3.1:testCompile 
>> (default-testCompile) @ ---
>> 
>> [INFO] Nothing to compile - all classes are up to date
>> 
>> [INFO]
>> 
>> [INFO] --- maven-surefire-plugin:2.7.1:test (default-test) @ ---
>> 
>> [INFO] --- maven-bundle-plugin:2.3.4:bundle (default-bundle) @ ---
>> 
>> [INFO]
>> 
>> [INFO] --- maven-install-plugin:2.3.1:install-file (install-features) 
>> @ ---
>> 
>> [INFO]
>> 
>> [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ ---
>> 
>> [INFO]
>> 
>> [INFO] --- maven-bundle-plugin:2.3.4:install (default-install) @ ---
>> 
>> [INFO]
>> 
>> [INFO] >>> features-maven-plugin:2.1.3:add-features-to-repo 
>> (make-repo) @ >>>
>> 
>> [INFO]
>> 
>> [INFO] --- build-helper-maven-plugin:1.5:parse-version (parse-version) 
>> @ ru.troika.cto.sms.provider.beeline.http ---
>> 
>> [INFO]
>> 
>> [INFO] --- maven-jaxb2-plugin:0.8.0:generate (generate-jaxb-classes) @ 
>> ru.troika.cto.sms.provider.beeline.http ---
>> 
>> [INFO]
>> 
>> [INFO] --- maven-antrun-plugin:1.5:run (default) @ 
>> ru.troika.cto.sms.provider.beeline.http ---
>> 
>> [INFO] Executing tasks
>> 
>> main:
>> 
>> [move] Moving 10 files to
>> C:\workspace\projects\myproj\trunk\provider\http\target\generated-sour
>> ces\xjc.bak
>> 
>> [copy] Copying 10 files to
>> C:\workspace\projects\myproj\trunk\provider\http\target\generated-sour
>> ces\xjc
>> 
>> [delete] Deleting directory
>> C:\workspace\projects\myproj\trunk\provider\http\target\generated-sour
>> ces\xjc.bak
>> 
>> [INFO] Executed tasks
>> 
>> [INFO]
>> 
>> [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ 
>> ---
>> 
>> [debug] execute contextualize
>> 
>> [INFO]
>> 
>> [INFO] --- maven-compiler-plugin:2.3.1:compile (default-compile) @ ---
>> 
>> [INFO]
>> 
>> [INFO] <<< features-maven-plugin:2.2.2:add-features-to-repo 
>> (make-repo) @ ru.troika.cto.sms.provider.beeline.http <<<
>> 
>> [INFO]
>> 
>> [INFO] --- features-maven-plugin:2.2.2:add-features-to-repo 
>> (make-repo) @ ru.troika.cto.sms.provider.beeline.http ---
>> 
>> [INFO] Copying bundle:
>> org.apache.servicemix.bundles:org.apache.servicemix.bundles.aopallianc
>> e:jar:1.0_4
>> 
>> ----
>> 
>> Best Regards,
>> 
>> Sergey Zhemzhitsky
>> 
>> Information Technology Division
>> 
>> Troika Dialog, 4, Romanov lane, Moscow 125009, Russia
>> 
>> Phone. +7 495 2580500 ext. 1246
>> 
>> _______________________________________________________
>> 
>> The information contained in this message may be privileged and conf 
>> idential and protected from disclosure. If you are not the original 
>> intended recipient, you are hereby notified that any review, 
>> retransmission, dissemination, or other use of, or taking of any 
>> action in reliance upon, this information is prohibited. If you have 
>> received this communication in error, please notify the sender 
>> immediately by replying to this message and delete it from your 
>> computer. Thank you for your cooperation. Troika Dialog, Russia.
>> 
>> If you need assistance please contact our Contact Center (+7495) 258
>> 0500 or go to www.troika.ru/eng/Contacts/system.wbp
>> 
> 
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
> 
> _______________________________________________________
> 
> The information contained in this message may be privileged and conf idential and protected
from disclosure. If you are not the original intended recipient, you are hereby notified that
any review, retransmission, dissemination, or other use of, or taking of any action in reliance
upon, this information is prohibited. If you have received this communication in error, please
notify the sender immediately by replying to this message and delete it from your computer.
Thank you for your cooperation. Troika Dialog, Russia. 
> If you need assistance please contact our Contact Center  (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp
 
> 


Mime
View raw message