Skip to content

Instantly share code, notes, and snippets.

@kingargyle
Last active December 17, 2015 03:09
Show Gist options
  • Select an option

  • Save kingargyle/5541356 to your computer and use it in GitHub Desktop.

Select an option

Save kingargyle/5541356 to your computer and use it in GitHub Desktop.
Example of using the p2-maven-plugin to create a p2 repo with source bundles from maven central or any maven repository.
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.kingargyle</groupId>
<artifactId>p2-orbit-repo-example</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.reficio</groupId>
<artifactId>p2-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<id>default-cli</id>
<phase>process-sources</phase>
<goals>
<goal>site</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<id>mysql:mysql-connector-java:jar:5.1.12</id>
<source>true</source>
<transitive>false</transitive>
</artifact>
<artifact>
<id>org.mongodb:mongo-java-driver:2.7.3</id>
<source>true</source>
<transitive>false</transitive>
</artifact>
<artifact>
<id>com.yahoo.platform.yui:yuicompressor:2.4.2</id>
<source>true</source>
<transitive>false</transitive>
</artifact>
<artifact>
<id>eu.medsea.mimeutil:mime-util:2.1.3</id>
<source>true</source>
<transitive>false</transitive>
</artifact>
<artifact>
<id>org.codehaus.groovy:groovy-all:1.8.0</id>
<source>true</source>
<transitive>false</transitive>
</artifact>
<artifact>
<id>org.eclipse.jetty.orbit:javax.el:2.1.0.v201105211819</id>
<source>true</source>
<transitive>false</transitive>
</artifact>
<artifact>
<id>javax.faces:jsf-api:1.2_12</id>
<source>true</source>
<transitive>false</transitive>
</artifact>
<artifact>
<id>javax.faces:jsf-impl:1.2_12</id>
<source>true</source>
<transitive>false</transitive>
</artifact>
<artifact>
<id>org.eclipse.jetty.orbit:javax.transaction:1.1.1.v201105210645</id>
<source>true</source>
<transitive>false</transitive>
</artifact>
<artifact>
<id>javax.ws.rs:jsr311-api:1.1.1</id>
<source>true</source>
<transitive>false</transitive>
</artifact>
<artifact>
<id>javax.xml.bind:jaxb-api:2.2</id>
<source>true</source>
<transitive>false</transitive>
</artifact>
<artifact>
<id>javax.xml:jaxp-api:1.4</id>
<source>true</source>
<transitive>false</transitive>
</artifact>
<artifact>
<id>net.java.dev.rome:rome:1.0.0</id>
<source>true</source>
<transitive>false</transitive>
</artifact>
<artifact>
<id>org.apache.activemq:activemq-core:5.6.0</id>
<source>true</source>
<transitive>false</transitive>
</artifact>
<artifact>
<id>org.apache.activemq:activemq-jaas:5.6.0</id>
<source>true</source>
<transitive>false</transitive>
</artifact>
<artifact>
<id>postgresql:postgresql:9.0-801.jdbc4</id>
<source>true</source>
<transitive>false</transitive>
<!-- <nouses>true</nouses> -->
<override>true</override>
<instructions>
<Bundle-SymbolicName>org.postgresql</Bundle-SymbolicName>
<Bundle-Version>9.0.801</Bundle-Version>
</instructions>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>reficio-maven</id>
<url>http://repo.reficio.org/maven/</url>
</repository>
<repository>
<id>eclipse-maven</id>
<url>http://maven.eclipse.org/nexus/content/repositories/testing/</url>
</repository>
<repository>
<id>intalio-org</id>
<url>http://www.intalio.org/public/maven2/</url>
</repository>
<repository>
<id>ettrema-repo</id>
<url>http://opensource.kantega.no/nexus/content/groups/public/</url>
</repository>
<repository>
<id>objectweb</id>
<url>http://repository.ow2.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>semweb4j</id>
<url>http://semweb4j.org/repo/</url>
</repository>
<repository>
<id>tmate</id>
<url>http://maven.tmatesoft.com/content/repositories/releases/</url>
</repository>
<repository>
<id>openhealth</id>
<url>http://repo.openehealth.org/maven2/releases/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>intalio-nexus</id>
<url>http://repo.reficio.org/maven/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
@nickboldt

Copy link
Copy Markdown

Missing a line, Dave.

[ERROR]   The project  (/home/nboldt/tmp/kingargyle_p2-example_pom.xml) has 1 error
[ERROR]     Non-parseable POM /home/nboldt/tmp/kingargyle_p2-example_pom.xml: end tag name </configuration> must match start tag name <artifacts> from line 24 (position: TEXT seen ...</artifact>\n              </configuration>... @374:31)  @ line 374, column 31 -> [Help 2]

Also, 1.0.0.M3 no longer exists. Try 1.0.1-SNAPSHOT instead.

@nickboldt

Copy link
Copy Markdown
[ERROR] Failed to execute goal org.reficio:p2-maven-plugin:1.0.1-SNAPSHOT:site (default-cli) on project p2-orbit-repo-example: Execution default-cli of goal org.reficio:p2-maven-plugin:1.0.1-SNAPSHOT:site failed: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact org.beanshell:com.springsource.bsh:jar:2.0.0.b4 in jboss-public-repository-group (http://repository.jboss.org/nexus/content/groups/public/) -> [Help 1]

Did you mean this?

http://repo.maven.apache.org/maven2/org/beanshell/bsh/2.0b4/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment