Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update P2 plugin to compile product with Java 21 #119

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 79 additions & 75 deletions carbon-p2-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,110 +27,114 @@
</parent>

<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.maven</groupId>
<artifactId>carbon-p2-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>5.2.50-SNAPSHOT</version>
<name>Maven P2 Profile Generation Plugin</name>

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${org.apache.maven.plugin.api.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${org.apache.maven.core.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>sisu-equinox-embedder</artifactId>
<version>${tycho.version}</version>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.9.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.9.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.11.0</version>
</dependency>
<!-- This version is needed for Java 21 compatibility.-->
<dependency>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.p2.publisher</artifactId>
<version>1.9.100</version>
</dependency>
<dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>sisu-equinox-launching</artifactId>
<version>${tycho.version}</version>
<version>4.0.6</version>
</dependency>
<dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-artifactcomparator</artifactId>
<version>4.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.14.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-facade</artifactId>
<version>${tycho.version}</version>
<artifactId>tycho-core</artifactId>
<version>4.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>${org.apache.maven.compat.version}</version>
<version>3.9.6</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>${org.apache.maven.project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.jvnet.maven.incrementalbuild</groupId>
<artifactId>incremental-build-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<goals>
<goal>incremental-build</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
<version>0.9.0.M2</version>
<executions>
<execution>
<id>index-project</id>
<goals>
<goal>main-index</goal>
<goal>test-index</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<goalPrefix>carbon-p2-plugin</goalPrefix>
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
<extractors>
<extractor>java-annotations</extractor>
</extractors>
</configuration>
<executions>
<execution>
<id>default-descriptor</id>
<goals>
<goal>descriptor</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.12.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>21</source>
<target>21</target>
<!-- Workaround for https://issues.apache.org/jira/browse/MCOMPILER-567 -->
<useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<configuration>
<includes>
<include>src/**/*</include>
<include>pom.xml</include>
</includes>
<!-- <excludes>
<exclude>**/*/MANIFEST.MF</exclude>
<exclude>.git</exclude>
<exclude>.gitignore</exclude>
<exclude>.idea</exclude>
<exclude>*.iws</exclude>
<exclude>*.iml</exclude>
<exclude>*.ipr</exclude>
<exclude>**/META-INF/services/javax.json.spi.JsonProvider</exclude>
<exclude>**/*.json</exclude>
<exclude>**/*.yml</exclude>
<exclude>**/bench/*.txt</exclude>
</excludes> -->
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
15 changes: 5 additions & 10 deletions carbon-p2-plugin/src/main/java/org/wso2/maven/p2/CatFeature.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,25 @@
import java.util.regex.Pattern;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.wso2.maven.p2.generate.feature.Bundle;

public class CatFeature {

/**
* Id of the feature
*
* @parameter
* @required
*/
@Parameter(name = "id", required = true)
private String id;

/**
* version of the feature
*
* @parameter
* @required
*/
@Parameter(name = "version", required = true)
private String version;

/**
* @parameter default-value="${project}"
*/

@Parameter(name = "project", defaultValue = "${project}")
private MavenProject project;

private boolean versionReplaced = false;
Expand Down
15 changes: 5 additions & 10 deletions carbon-p2-plugin/src/main/java/org/wso2/maven/p2/Category.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,33 @@
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;

public class Category {

/**
* Category Id
*
* @parameter
* @required
*/
@Parameter(name = "id", required = true)
private String id;

/**
* Category Label
*
* @parameter
*/
@Parameter(name = "label")
private String label;

/**
* Category description
*
* @parameter
*/
@Parameter(name = "description")
private String description;

/**
* List of features contained in the category
*
* @parameter
* @required
*/
@Parameter(name = "features", required = true)
private ArrayList<CatFeature> features;

private ArrayList<CatFeature> processedFeatures;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,21 @@

import java.util.ArrayList;

import org.apache.maven.plugins.annotations.Parameter;
import org.wso2.maven.p2.generate.utils.P2Constants;

public class EquinoxLauncher {

/**
* Name of the launcher jar
*
* @parameter
*/
@Parameter(name = "launcherJar")
private String launcherJar;

/**
* launcherFiles
*
* @parameter
*/
@Parameter(name = "launcherFiles")
private ArrayList launcherFiles;

public EquinoxLauncher(){
Expand Down
9 changes: 3 additions & 6 deletions carbon-p2-plugin/src/main/java/org/wso2/maven/p2/Feature.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,22 @@
package org.wso2.maven.p2;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Parameter;
import org.wso2.maven.p2.generate.feature.Bundle;
import org.wso2.maven.p2.generate.feature.ImportFeature;

public class Feature {

/**
* Id of the feature
*
* @parameter
* @required
*/
@Parameter(name = "id", required = true)
private String id;

/**
* version of the feature
*
* @parameter
* @required
*/
@Parameter(name = "version", required = true)
private String version;

public Feature(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,26 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.Dependency;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;

public class FeatureArtifact {
/**
* Group Id of the Bundle
*
* @parameter
* @required
*/
@Parameter(name = "groupId", required = true)
private String groupId;

/**
* Artifact Id of the Bundle
*
* @parameter
* @required
*/
@Parameter(name = "artifactId", required = true)
private String artifactId;

/**
* Version of the Bundle
*
* @parameter default-value=""
*/
@Parameter(name = "version")
private String version;

private Artifact artifact;
Expand Down
Loading