1
votes

Project structure

com.abc.parent - parent pom Contains all the plugins required for the modules. And the module execution list.

com.abc.p2 - master P2 project - eclipse repository Contains the category.xml file with the information related to the below mentioned eclipse plugins.

com.abc.common - eclipse plugin

com.abc.person - eclipse plugin

What we want to achieve

We are introducing Maven for the first time for these project . We want to create a P2 repository using Maven ( mostly by using maven tycho plugin or any other standard available plugins ). Also , we wish to publish this repository to a site location.

What we tried until now

Case 1: Approach - We used Maven Tycho plugin and added the packaging as "eclipse-repository" for the com.abc.p2 project. We have following plugins in the pom.xml files We are using Maven tycho plugin with version - 0.24.0 Maven tycho plugin. maven-p2-repository , tycho-packaging plugin , maven-osgi-plugin

    Errors    - 
                [ERROR]     Unknown packaging: eclipse-repository @ line 6, column 14
                [ERROR]
                [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
                ch.
                [ERROR] Re-run Maven using the -X switch to enable full debug logging.
                [ERROR]
                [ERROR] For more information about the errors and possible solutions, please rea
                d the following articles:
                [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin
                gException

Case 2 : Approach - We used Maven-p2-plugin in order to create P2 repository .

    Errors   - 
                We were able to generate the P2-repository structure in the target folder of the master project, , but it failed to package all the dependent modules in the p2-repository.

Next steps suggestions

Request you to kindly assist and suggest , if we are on the right track in order to achieve our goal . Also let me know in case any changes required to my approach and any more additional things to be implemented.

2

2 Answers

0
votes

For tycho to work you need an extensions.xml file in a .mvn folder in the root of your project (where the root pom.xml is) with the following contents:

<extensions>
<extension>
    <groupId>org.eclipse.tycho.extras</groupId>
    <artifactId>tycho-pomless</artifactId>
    <version>0.26.0</version>
</extension></extensions>

As you can see in the excellent Vogella tutorial

0
votes

I would suggest using the tycho-p2-repository plugin.

In case 1, the maven repository plugin does not know the packaging "eclipse-repository" as that packaging is defined by tycho. I suggest simply leaving the maven-packaging plugin out of your pom and let tycho apply its defaults.

One helpful tip: Tycho does not include all dependencies, even though that's normal and desired maven behaviour. As maven does not "see" tycho (so manifest-derived) dependencies, they are not included.

You can override this behaviour by setting to true:

<plugin>
 <groupId>org.eclipse.tycho</groupId>
 <artifactId>tycho-p2-repository-plugin</artifactId>
 <version>${tycho-version}</version>
 <configuration>
    <includeAllDependencies>true</includeAllDependencies>
 </configuration>
</plugin>