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

m2e PDE integration for features #1631

Open
vogella opened this issue Dec 20, 2023 · 1 comment
Open

m2e PDE integration for features #1631

vogella opened this issue Dec 20, 2023 · 1 comment

Comments

@vogella
Copy link
Contributor

vogella commented Dec 20, 2023

AFAICS the m2e PDE integration for features written by @ptziegler does not use the pom information but the feature.xml.

If a feature includes another feature, this meta-data is currently not used. It is present in the feature.xml in the Maven repository and in the generated pom file for the feature as dependencies.

Example:

1.) Clone https://github.com/vogellacompany/pde-feature-dependencies
2.) Run mvn clean verify to check that regular builds works
3.) Publish the result to a file based Maven repository via ´mvn deploy -DaltDeploymentRepository=snapshot-repo::default::file:/path-to-your-repo/test-repo´
4.) Check meta-data of feature2 in the Mavne repo (which is correct)

feature2-1.0.0-TIMESTAMP.pom:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://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>vogella</groupId>
  <artifactId>feature2</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>[feature] Feature2</name>
  <dependencies>
    <dependency>
      <groupId>vogella</groupId>
      <artifactId>feature1</artifactId>
      <version>1.0.0-SNAPSHOT</version>
      <scope>compile</scope>
      <optional>false</optional>
    </dependency>
    <dependency>
      <groupId>vogella</groupId>
      <artifactId>plugin1</artifactId>
      <version>1.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
</project>

feature.xml from the generated JAR file:


<feature id="feature2" label="Feature2" version="1.0.0.202312201529">
<description url="http://www.example.com/description"> [Enter Feature Description here.] </description>
<copyright url="http://www.example.com/copyright"> [Enter Copyright Description here.] </copyright>
<license url="http://www.example.com/license"> [Enter License Description here.] </license>
<includes id="feature1" version="1.0.0.202312201529"/>
</feature>

If I setup a target file using this this Maven repository as backup, the dependencies are not make available:

Example target file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="feature-targetplatform">
	<locations>
		<location includeDependencyDepth="infinite" includeDependencyScopes="compile" includeSource="true" missingManifest="generate" type="Maven">
			<dependencies>
					<dependency>
					<groupId>vogella</groupId>
					<artifactId>feature2</artifactId>
 					<version>1.0.0-SNAPSHOT</version>
				</dependency>
			</dependencies>
			<repositories>
				<repository>
					<id>localRepository</id>
					<url>file:///tmp/test-repo2</url>
				</repository>
			</repositories>
		</location>
	</locations>
</target>

Expection would be that feature1 and plugin1 are also added to the target platform as both the feature.xml file and the pom.xml for the feature2 declare "feature1" as dependency.

@ptziegler
Copy link
Contributor

Are those local changes? Because that's the content of the feature.xml in feature2, without any reference to feature1

<?xml version="1.0" encoding="UTF-8"?>
<feature
      id="feature2"
      label="Feature2"
      version="1.0.0.qualifier">

   <description url="http://www.example.com/description">
      [Enter Feature Description here.]
   </description>

   <copyright url="http://www.example.com/copyright">
      [Enter Copyright Description here.]
   </copyright>

   <license url="http://www.example.com/license">
      [Enter License Description here.]
   </license>
</feature>

That said, I've added the dependency manually and once I've built everything, this is what the target definition looks like:
(Side note, I did a mvn clean install instead of building a local repository)

image

Expection would be that feature1 and plugin1 are also added to the target platform as both the feature.xml file and the pom.xml for the feature2 declare "feature1" as dependency.

That would also be my expectation. From my understanding of Maven, when feature1 is a pom dependency, it should be added to the classpath regardless of whether it's contained by the feature.xml.
This is also how Tycho should do it, which is why I find it weird that this doesn't work here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants