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

org.eclipse.tycho:tycho-compiler-plugin:4.0.8:validate-classpath fails wth ds 1.4 #4060

Closed
mikerumpf opened this issue Jul 18, 2024 · 3 comments

Comments

@mikerumpf
Copy link

When builing with the following tycho-ds-plugin settings and having updated dsVersion from 1.3 to 1.4

            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-ds-plugin</artifactId>
                <version>${tycho.version}</version>
                <configuration>
                    <classpath>true</classpath>
                    <dsVersion>1.4</dsVersion>
                    <enabled>true</enabled>
                    <path>OSGI-INF</path>
                    <skip>${tycho-ds.skip}</skip>
                </configuration>
            </plugin>

bundle compilation fails on some bundles with the following error:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:4.0.8:validate-classpath (default-validate-classpath) on project my.test.application2: Execution default-validate-classpath of goal org.eclipse.tycho:tycho-compiler-plugin:4.0.8:validate-classpath failed: org.osgi.framework.BundleException: Bundle my.test.application2 cannot be resolved:my.test.application2 [34]
[ERROR]   Unresolved requirement: Import-Package: myi.test.application
[ERROR]     -> Export-Package: my.test.application; bundle-symbolic-name="my.test.application"; bundle-version="8.0.1.202407181250"; version="0.0.0"
[ERROR]        my.test.application [33]
[ERROR]          Unresolved requirement: Import-Package: edu.umd.cs.findbugs.annotations; resolution:="optional"
[ERROR]          Unresolved requirement: Require-Capability: osgi.extender; filter:="(&(osgi.extender=osgi.component)(version>=1.4.0)(!(version>=2.0.0)))"
[ERROR] -> [Help 1]

A quick fix would be to add org.apache.felix.scr to the bundle dependencies. But am I missing something? My guess is that capabilities shouldn't be validated at compile level...

Thanks in advance for any help.
@laeubi
Copy link
Member

laeubi commented Jul 18, 2024

This is likely due to

can you check if adding

<plugin>
	<groupId>org.eclipse.tycho</groupId>
	<artifactId>target-platform-configuration</artifactId>
	<version>${tycho.version}</version>
	<configuration>
		...
		<dependency-resolution>
			<extraRequirements>
				<requirement>
					<type>eclipse-plugin</type>
					<id>org.apache.felix.scr</id>
					<versionRange>0.0.0</versionRange>
				</requirement>
			</extraRequirements>
		</dependency-resolution>
	</configuration>
</plugin>

works as a workaround?

@mikerumpf
Copy link
Author

Yes, the workaround works. Thanks a lot! :-)

@mikerumpf
Copy link
Author

This issue is a duplicate. I will close it

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