Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Attaching additional artifacts with eclipse-feature packaging

It seems to work now. I'm not sure what happened or what I modified exactly. Probably a typo somewhere.

Sorry for that.
-Seb

On Thu, Jan 8, 2015 at 5:10 PM, Sebastien Arod <sebastien.arod@xxxxxxxxx> wrote:
Hi,

We are currently building a Eclipse RAP project with tycho.

To do that we have several plugins that are grouped as an eclipse-feature. In order to build a war for the application we added an ant step in the feature pom.xml that creates the war from the eclipse-feature result (target/site/plugins) and attach this as an artifact using build-helper-maven-plugin.

Then we need to bundle this war + the content of the documentation zip artifact into a zip file.
To create this zip file I need to create a maven module that depends on the zip and war artifact.

However it fails to resolve the dependency to the war artifact.

When executing with -X. I see a line "Could not find metadata myGroup:war.feature:1.0.0-SNAPSHOT/maven-metadata.xml"

And when I look in my local repository file it seems that there is no metadata file in the myGroup/war.feature/ folder.

Is it a limiation of the feature packaging that prevents me from attaching artifacts? How can I achieve a similar goal?


Here are the extracts from the pom files
-----

pom.xml for feature looks something like this.
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
     <groupId>myGroup</groupId>
    <artifactId>war.feature</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>eclipse-feature</packaging> 
  <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>generate-war</id>
                        <phase>package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target >
                                ... build war file ...
                            </target>
                        </configuration>
                    </execution>
                </executions>               
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.9</version>
                <executions>
                    <execution>
                        <id>attach-war</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${war.file}</file>
                                    <type>war</type>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


pom.xml of the project building the final zip
<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>
    <packaging>pom</packaging>
    <groupId>myGroup</groupId>
    <artifactId>packaging</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <dependencies>
         <dependency>
            <groupId>myGroup</groupId>
            <artifactId>war.feature</artifactId>   
            <version>1.0.0-SNAPSHOT</version>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>myGroup</groupId>
            <artifactId>documentation</artifactId>   
            <version>1.0.0-SNAPSHOT</version>
            <type>zip</type>
        </dependency>
     </dependencies>
     <build>
...
     </build>
</project>


Back to the top