Skip to content

Commit

Permalink
[Maven-Runtime] Convert projects into standard Maven-projects (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesWell committed Nov 20, 2022
1 parent 3141109 commit 113b0ec
Show file tree
Hide file tree
Showing 21 changed files with 257 additions and 403 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/licensecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,5 @@ jobs:
uses: eclipse/dash-licenses/.github/workflows/mavenLicenseCheck.yml@master
with:
projectId: technology.m2e
setupScript: |
mvn clean generate-sources -f m2e-maven-runtime/pom.xml -B -Dtycho.mode=maven -Pgenerate-osgi-metadata
secrets:
gitlabAPIToken: ${{ secrets.M2E_GITLAB_API_TOKEN }}
2 changes: 0 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml', '**/*.target') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Generated Meta data
run: mvn generate-sources -f m2e-maven-runtime -B -V -Pgenerate-osgi-metadata -Dtycho.mode=maven
- name: Build m2e-core
uses: GabrielBB/xvfb-action@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<extension>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-pomless</artifactId>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-build</artifactId>
<version>3.0.0</version>
</extension>
</extensions>
11 changes: 5 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,15 @@ Some tests are in a separate repository which is referenced as a Git submodule i

### 🏗️ Build

The full Maven build of Eclipse m2e is performed in two subsequent steps.
In order to build m2e on the command line, run the following commands subsequently from the root of this repo's clone
In order to build m2e on the command line, run the following command from the root of this repo's clone

1. `mvn generate-sources -f m2e-maven-runtime -Pgenerate-osgi-metadata -Dtycho.mode=maven`
2. `mvn clean verify`
`mvn clean verify`

Within the Eclipse-IDE both builds can be run using the Maven Launch-Configurations *m2e-maven-runtime--generate-OSGi-metadata* respectively *m2e-core--build*. The Launch-Configuration *m2e-core--build-all* runs both builds subsequently.
Within the Eclipse-IDE the build can be run using the Maven Launch-Configuration *m2e-core--build*.
The (long-running) integration tests are skipped by default, add `-Pits` to your command in order to run them; adding `-DskipTests` will skip all tests, within Eclipse one can run *m2e-core--build-with-integration-tests*.

If you have unresolved errors or are going to modify the Maven runtime components in _m2e-maven-runtime_ folder (typically to change version of Maven runtime, indexer, archetypes... that are shipped by default with m2e), you may want to launch the `m2e-maven-runtime--generate-OSGi-metadata` Run-configuration or trigger the Oomph-setup manually. See `m2e-maven-runtime/README.md` for details.
If you have unresolved errors refreshing the `m2e-maven-runtime` project and/or performing a `Clean` + `Full` build may solve them.
If are going to modify the Maven runtime components in `m2e-maven-runtime` folder you may want to delete the `target` folder of the affected sub-project and refresh and `Clean` + `Full` build it in order to ensure consistency.

### ⬆️ Version bump

Expand Down
1 change: 0 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ pipeline {
}
stage('Build') {
steps {
sh 'mvn clean generate-sources -f m2e-maven-runtime/pom.xml -B -V -Dtycho.mode=maven -Pgenerate-osgi-metadata'
withCredentials([string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE')]) {
wrap([$class: 'Xvnc', useXauthority: true]) {
sh 'mvn clean verify -B -V \
Expand Down
2 changes: 1 addition & 1 deletion m2e-maven-runtime/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.classpath
.settings/
.project
META-INF/
jars/
17 changes: 0 additions & 17 deletions m2e-maven-runtime/.project

This file was deleted.

18 changes: 5 additions & 13 deletions m2e-maven-runtime/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@

The Maven-Runtime bundles are ordinary Eclipse-Plugins that facilitate Maven to fetch Maven-dependency jars (and their sources) from a Maven-repository
and to generate corresponding MANIFEST.MF and .classpath files that include all fetched jars accordingly.
The Maven-Runtime bundles are ordinary Maven-Projects that facilitate Maven to fetch Maven-dependency jars (and their sources) from a Maven-repository
and use the bnd-maven-plugin to generate a corresponding MANIFEST.MF that has all fetched jars on the `Bundle-ClassPath`.
Consequently the content of those files and folders is fully controlled by the project's pom.xml (and its parent) and should only be adjusted via the pom.
Those files/folders are ignored by git and direct changes are therefore lost upon the next metadata-generation.

Therefore two builds are necessary to build m2e from scratch:
1. A pure Maven build (tycho.mode=maven), to fetch all jars and to generate the MANIFEST.MF and .classpath file for each Maven-runtime project.
2. An ordinary 'Eclipse-Tycho' build, where the Maven-runtime plug-ins are build like ordinary Eclipse plug-ins together with all other m2e Eclipse-Plugins.

In the Eclipse-IDE the first build is executed by the Oomph setup on every start-up or when triggered manually in order to re-generate the the mentioned files.
To re-generate the OSGi metadata of the Maven-runtime bundles you can either run the first step of the Maven build as mentioned [in the Build section of the CONTRIBUTING guide](../CONTRIBUTING.md#🏗️ Build), launch the corresponding Run-configuration or perform the Oomph-setup tasks for m2e (manually or by restarting your Eclipse-IDE).

Compared to the previous approach this one has the advantage, that the Maven-runtime bundles can be build together with all other m2e plug-ins.
The Maven-runtime projects then participate directly in the PDE build and are directly included when launching another Eclipse from the IDE (e.g. for testing).
They don't have to be included by installing them into the local .m2 repo and loading into the target-platform anymore, which simplifies their handling in the IDE and during build.
Furthermore sources of the embedded jars are also available in the IDE.
This one has the advantage, that the Maven-runtime bundles can be build together with all other m2e plug-ins.
The children of this project then participate directly in the PDE workspace build in the IDE and are directly included when launching another Eclipse from the IDE (e.g. for testing).
This is possible due to the connector for the bnd-maven-plugin which is part of m2e.
34 changes: 0 additions & 34 deletions m2e-maven-runtime/org.eclipse.m2e.archetype.common/.project

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion m2e-maven-runtime/org.eclipse.m2e.archetype.common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<artifactId>org.eclipse.m2e.archetype.common</artifactId>
<version>3.2.101-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<packaging>jar</packaging>

<name>M2E Maven Archetype Common</name>

Expand Down
34 changes: 0 additions & 34 deletions m2e-maven-runtime/org.eclipse.m2e.maven.runtime/.project

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# This file tells the Maven build to sign the jnilibs contained in built jar
# see the eclipse-sign-jnilibs profile defined in the parent pom
jars.directory = jars
jars.directory = target/jars
6 changes: 3 additions & 3 deletions m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<artifactId>org.eclipse.m2e.maven.runtime</artifactId>
<version>3.8.602-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<packaging>jar</packaging>

<name>M2E Embedded Maven Runtime (includes Incubating components)</name>

Expand Down Expand Up @@ -157,8 +157,8 @@
slf4jBinding=maven-slf4j-provider-${maven-core.version}.jar
M2E-SLF4JBinding=jars/${slf4jBinding}
-includeresource: \
jars/=jars/;recursive:=false;lib:=true;filter:=!${slf4jBinding},\
jars/=jars/${slf4jBinding};lib:=false
jars/=${jars.directory}/;recursive:=false;lib:=true;filter:=!${slf4jBinding},\
jars/=${jars.directory}/${slf4jBinding};lib:=false
-exportcontents: \
META-INF.plexus;-noimport:=true;x-internal:=true,\
META-INF.sisu;-noimport:=true;x-internal:=true,\
Expand Down
Loading

0 comments on commit 113b0ec

Please sign in to comment.