Hi,
I'm trying to package m2e-wtp now. I used the m2e-cxf as inspiration for my spec file. I get the following error however when I run rpmbuild -ba on it:
Internal error: java.lang.RuntimeException: No solution found because the problem is unsatisfiable.: [Unable to satisfy dependency from org.eclipse.m2e.wtp.overlay 1.1.0.qualifier to bundle org.slf4j.api 1.6.0.; No solution found because the problem is unsatisfiable.
I thought that I could fix this by adding 'BuildRequires: mvn(org.slf4j:slf4j-api)' but that doesn't seem to work. The regular Maven build works without problems.
Could someone give me a clue on how I should proceed from here? I have attached the spec file I have thus far.
Thanks in advance, Julius
On 02/20/2015 01:09 PM, Julius Schwartzenberg wrote:
Hi,
I'm trying to package m2e-wtp now. I used the m2e-cxf as inspiration for my spec file. I get the following error however when I run rpmbuild -ba on it:
Internal error: java.lang.RuntimeException: No solution found because the problem is unsatisfiable.: [Unable to satisfy dependency from org.eclipse.m2e.wtp.overlay 1.1.0.qualifier to bundle org.slf4j.api 1.6.0.; No solution found because the problem is unsatisfiable.
I thought that I could fix this by adding 'BuildRequires: mvn(org.slf4j:slf4j-api)' but that doesn't seem to work. The regular Maven build works without problems.
Could someone give me a clue on how I should proceed from here? I have attached the spec file I have thus far.
SLF4J in Fedora uses a different Bundle-SymbolicName. You'll need to patch MANIFEST.MF and replace org.slf4j.api with slf4j.api, for example:
# SLF4J in Fedora uses a different BSN sed -i s/org.slf4j.api/slf4j.api/ $(find -name *.MF)
See also eclipse-m2e-plexus.spec
Hi,
Thanks for your quick response!
On 02/20/2015 01:12 PM, Mikolaj Izdebski wrote:
# SLF4J in Fedora uses a different BSN sed -i s/org.slf4j.api/slf4j.api/ $(find -name *.MF)
This indeed solved the problem!
I added a few more dependencies and now I'm running into this error:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:0.21.0:package-plugin (default-package-plugin) on project org.eclipse.m2e.wtp.overlay: Execution default-package-plugin of goal org.eclipse.tycho:tycho-packaging-plugin:0.21.0:package-plugin failed: One of setGitDir or setWorkTree must be called. -> [Help 1]
Is this related to these %global lines at the top? I wasn't sure what to do with them.
Best regards, Julius
On 02/20/2015 01:45 PM, Julius Schwartzenberg wrote:
I added a few more dependencies and now I'm running into this error:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:0.21.0:package-plugin (default-package-plugin) on project org.eclipse.m2e.wtp.overlay: Execution default-package-plugin of goal org.eclipse.tycho:tycho-packaging-plugin:0.21.0:package-plugin failed: One of setGitDir or setWorkTree must be called. -> [Help 1]
Is this related to these %global lines at the top? I wasn't sure what to do with them.
My guess is that upstream is using older version of Tycho and you'll need to port the build to Tycho 0.21.0 (patch pom.xml).
On 02/20/2015 02:54 PM, Mikolaj Izdebski wrote:
On 02/20/2015 01:45 PM, Julius Schwartzenberg wrote:
I added a few more dependencies and now I'm running into this error:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:0.21.0:package-plugin (default-package-plugin) on project org.eclipse.m2e.wtp.overlay: Execution default-package-plugin of goal org.eclipse.tycho:tycho-packaging-plugin:0.21.0:package-plugin failed: One of setGitDir or setWorkTree must be called. -> [Help 1]
My guess is that upstream is using older version of Tycho and you'll need to port the build to Tycho 0.21.0 (patch pom.xml).
I'm patching pom.xml as part of the build now to use Tycho 0.21.0 (was indeed 0.20.0), but I still receive the same error.
Is there anything else I could look at?
Thanks, Julius
On 02/20/2015 04:19 PM, Julius Schwartzenberg wrote:
On 02/20/2015 02:54 PM, Mikolaj Izdebski wrote:
On 02/20/2015 01:45 PM, Julius Schwartzenberg wrote:
I added a few more dependencies and now I'm running into this error:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:0.21.0:package-plugin (default-package-plugin) on project org.eclipse.m2e.wtp.overlay: Execution default-package-plugin of goal org.eclipse.tycho:tycho-packaging-plugin:0.21.0:package-plugin failed: One of setGitDir or setWorkTree must be called. -> [Help 1]
My guess is that upstream is using older version of Tycho and you'll need to port the build to Tycho 0.21.0 (patch pom.xml).
I'm patching pom.xml as part of the build now to use Tycho 0.21.0 (was indeed 0.20.0), but I still receive the same error.
Is there anything else I could look at?
You can upload your package somewhere and let me take a look. I may be able to see what's the problem.
On 02/20/2015 05:24 PM, Mikolaj Izdebski wrote:
On 02/20/2015 04:19 PM, Julius Schwartzenberg wrote:
Is there anything else I could look at?
You can upload your package somewhere and let me take a look. I may be able to see what's the problem.
That would be really great. I uploaded everything here: https://yadi.sk/d/dYebB-MCL4smQ/m2e-wtp_fedora
Thanks in advance!
On 02/20/2015 02:54 PM, Mikolaj Izdebski wrote:
On 02/20/2015 01:45 PM, Julius Schwartzenberg wrote:
I added a few more dependencies and now I'm running into this error:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:0.21.0:package-plugin (default-package-plugin) on project org.eclipse.m2e.wtp.overlay: Execution default-package-plugin of goal org.eclipse.tycho:tycho-packaging-plugin:0.21.0:package-plugin failed: One of setGitDir or setWorkTree must be called. -> [Help 1]
My guess is that upstream is using older version of Tycho and you'll need to port the build to Tycho 0.21.0 (patch pom.xml).
I'm patching pom.xml as part of the build now to use Tycho 0.21.0 (was indeed 0.20.0), but I still receive the same error.
The issue is related to something else, but the reason this wouldn't have worked is because your maven rpm build would resolve the version of Fedora installed on your system (through rpm). Changing the version property would have no effect, so in these cases one has to look at what changed in the newer version and adapt the pom files to reflect that.
From: "Mikolaj Izdebski" mizdebsk@redhat.com To: java-devel@lists.fedoraproject.org Sent: Wednesday, February 25, 2015 7:24:18 AM Subject: Re: [fedora-java] Packaging m2e-wtp
This is a bug in tycho-extras. I've just filed it: https://bugzilla.redhat.com/show_bug.cgi?id=1196167
As workaround you can add to %prep: %pom_remove_plugin :tycho-packaging-plugin
As mentioned in the bug, the error is a bit cryptic but expected. You basically need to decide whether you want to include a shallow copy of the git history in the sources to allow generating qualifiers based on the last commit made to the sub-project, or not. If you don't want build qualifiers based on commit date, then I believe Mikolaj's suggestion of removing the packaging plugin entirely should work (it will run anyways with default settings).
Cheers,
On 02/26/2015 05:38 PM, Roland Grunberg wrote:
From: "Mikolaj Izdebski" mizdebsk@redhat.com To: java-devel@lists.fedoraproject.org Sent: Wednesday, February 25, 2015 7:24:18 AM Subject: Re: [fedora-java] Packaging m2e-wtp
As workaround you can add to %prep: %pom_remove_plugin :tycho-packaging-plugin
As mentioned in the bug, the error is a bit cryptic but expected. You basically need to decide whether you want to include a shallow copy of the git history in the sources to allow generating qualifiers based on the last commit made to the sub-project, or not. If you don't want build qualifiers based on commit date, then I believe Mikolaj's suggestion of removing the packaging plugin entirely should work (it will run anyways with default settings).
Alright, thanks for the information. Is there any best practice regarding this? I hope the package could be included with Fedora at some point.
Considering that the releases already have a version number, including the GIT qualifiers as well does not really seem necessary. The regular Maven build does not require this however, so it does seem like something Fedora-specific to me.
Thanks, Julius
On 27 February 2015 at 08:28, Julius Schwartzenberg < julius.schwartzenberg@abz.nl> wrote:
On 02/26/2015 05:38 PM, Roland Grunberg wrote:
From: "Mikolaj Izdebski" mizdebsk@redhat.com To: java-devel@lists.fedoraproject.org Sent: Wednesday, February 25, 2015 7:24:18 AM Subject: Re: [fedora-java] Packaging m2e-wtp
As workaround you can add to %prep: %pom_remove_plugin :tycho-packaging-plugin
As mentioned in the bug, the error is a bit cryptic but expected. You basically need to decide whether you want to include a shallow copy of the git history in the sources to allow generating qualifiers based on the last commit made to the sub-project, or not. If you don't want build qualifiers based on commit date, then I believe Mikolaj's suggestion of removing the packaging plugin entirely should work (it will run anyways with default settings).
Alright, thanks for the information. Is there any best practice regarding this? I hope the package could be included with Fedora at some point.
Considering that the releases already have a version number, including the GIT qualifiers as well does not really seem necessary. The regular Maven build does not require this however, so it does seem like something Fedora-specific to me.
Thanks, Julius -- java-devel mailing list java-devel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/java-devel
In other fedora packages we just remove the jgit dependencies, for example see eclipse-mylyn.spec lines 243-246:
http://pkgs.fedoraproject.org/cgit/eclipse-mylyn.git/tree/eclipse-mylyn.spec...
I think this is an acceptible workaround
On 02/27/2015 10:38 AM, Mat Booth wrote:
In other fedora packages we just remove the jgit dependencies, for example see eclipse-mylyn.spec lines 243-246:
http://pkgs.fedoraproject.org/cgit/eclipse-mylyn.git/tree/eclipse-mylyn.spec...
I think this is an acceptible workaround
That works great! Thanks a lot. Now I'm running into the next problem. The output I get now is: [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.21.0:compile (default-compile) on project org.eclipse.m2e.wtp: Compilation failure: Compilation failure: [ERROR] /home/vagrant/rpmbuild/BUILD/m2e.wtp-releases-1.1.0-1.1.0.20140611-1646/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/namemapping/PatternBasedFileNameMapping.java:[12] [ERROR] import org.apache.maven.plugin.war.util.MappingUtils; [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] The import org.apache.maven.plugin.war cannot be resolved [ERROR] /home/vagrant/rpmbuild/BUILD/m2e.wtp-releases-1.1.0-1.1.0.20140611-1646/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/namemapping/PatternBasedFileNameMapping.java:[37] [ERROR] return MappingUtils.evaluateFileNameMapping(pattern, artifact); [ERROR] ^^^^^^^^^^^^ [ERROR] MappingUtils cannot be resolved
However I have added a "BuildRequires: mvn(org.apache.maven.plugins:maven-war-plugin:pom:)" and the JAR from this package (maven-war-plugin) does include this package & class.
The only thing I see is that the POM refers to version 2.2 but Fedora has 2.4, but I understood that that would be fixed automatically (like with the Tycho version differences). The class structure hasn't changed either. I suspect I'm missing something silly. I've attached my spec file. What could be going wrong?
Thanks, Julius
That works great! Thanks a lot. Now I'm running into the next problem. The output I get now is: [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.21.0:compile (default-compile) on project org.eclipse.m2e.wtp: Compilation failure: Compilation failure: [ERROR] /home/vagrant/rpmbuild/BUILD/m2e.wtp-releases-1.1.0-1.1.0.20140611-1646/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/namemapping/PatternBasedFileNameMapping.java:[12] [ERROR] import org.apache.maven.plugin.war.util.MappingUtils; [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] The import org.apache.maven.plugin.war cannot be resolved [ERROR] /home/vagrant/rpmbuild/BUILD/m2e.wtp-releases-1.1.0-1.1.0.20140611-1646/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/namemapping/PatternBasedFileNameMapping.java:[37] [ERROR] return MappingUtils.evaluateFileNameMapping(pattern, artifact); [ERROR] ^^^^^^^^^^^^ [ERROR] MappingUtils cannot be resolved
However I have added a "BuildRequires: mvn(org.apache.maven.plugins:maven-war-plugin:pom:)" and the JAR from this package (maven-war-plugin) does include this package & class.
The only thing I see is that the POM refers to version 2.2 but Fedora has 2.4, but I understood that that would be fixed automatically (like with the Tycho version differences). The class structure hasn't changed either. I suspect I'm missing something silly. I've attached my spec file. What could be going wrong?
It appears that MappingUtils has been removed in 2.5 (it was present in 2.4). See :
http://maven.apache.org/plugins-archives/maven-war-plugin-2.4/apidocs/org/ap... http://maven.apache.org/plugins-archives/maven-war-plugin-2.5/apidocs/org/ap...
I haven't looked into it but you may need to find a document that either explains how to migrate, or figure out what MappingUtils did and how the functionality is provided in 2.5+ .
Cheers,
It appears that MappingUtils has been removed in 2.5 (it was present in 2.4). See :
http://maven.apache.org/plugins-archives/maven-war-plugin-2.4/apidocs/org/ap... http://maven.apache.org/plugins-archives/maven-war-plugin-2.5/apidocs/org/ap...
I haven't looked into it but you may need to find a document that either explains how to migrate, or figure out what MappingUtils did and how the functionality is provided in 2.5+ .
Just to clarify, I'm assuming you're running the build on f22 or greater as this would have maven-war-plugin 2.5. On f21 or below, 2.4 should be available.
Cheers,
It appears that MappingUtils has been removed in 2.5 (it was present in 2.4). See :
http://maven.apache.org/plugins-archives/maven-war-plugin-2.4/apidocs/org/ap... http://maven.apache.org/plugins-archives/maven-war-plugin-2.5/apidocs/org/ap...
I haven't looked into it but you may need to find a document that either explains how to migrate, or figure out what MappingUtils did and how the functionality is provided in 2.5+ .
Just to clarify, I'm assuming you're running the build on f22 or greater as this would have maven-war-plugin 2.5. On f21 or below, 2.4 should be available.
Ok once again, sorry.. ignore all that. I was jumping to conclusions far too quickly. The mere fact that 'org.apache.maven.plugin.war' package isn't getting resolved rules out any kind of version issue. I believe the problem is that you're trying to use maven-war-plugin classes but the jar itself is not an OSGi bundle, so Tycho cannot find them.
I would guess filing a bug to OSGi-ify maven-war-plugin might be in order, but not sure of the implications in terms of other deps.
Cheers,
On 02/27/2015 06:44 PM, Roland Grunberg wrote:
Ok once again, sorry.. ignore all that. I was jumping to conclusions far too quickly. The mere fact that 'org.apache.maven.plugin.war' package isn't getting resolved rules out any kind of version issue. I believe the problem is that you're trying to use maven-war-plugin classes but the jar itself is not an OSGi bundle, so Tycho cannot find them.
That makes sense! I'd been a while since I was working with Tycho. I'm indeed working with Fedora 21, with maven-war-plugin version 2.4.
I would guess filing a bug to OSGi-ify maven-war-plugin might be in order, but not sure of the implications in terms of other deps.
Is this something which is specifically missing from the RPM package? A regular Maven build works, so I suppose there also exists a OSGI-ified version for Tycho.
Would it make the most sense to file a bugreport on that or look myself into getting the OSGI-ified version packaged (as well) or OSGI-ify the existing package?
Thanks, Julius
I would guess filing a bug to OSGi-ify maven-war-plugin might be in order, but not sure of the implications in terms of other deps.
Is this something which is specifically missing from the RPM package? A regular Maven build works, so I suppose there also exists a OSGI-ified version for Tycho.
Yes, the maven-war-plugin jar has a MANIFEST.MF that is missing at the very least Bundle-SymbolicName, and some other attributes that are commonly used to describe what the package will provide/require in that runtime.
The reason an upstream maven build works is because the plugin org.eclipse.m2e.wtp bundles the maven-war-plugin jar as part of its classpath [1]. You'd see it in the jars folder from the subproject. Your second call after %%setup removes all pre-built jars so that's why your build fails.
There may be a workaround you could try that would avoid having to OSGi-ify maven-war-plugin. If you add the attribute 'Eclipse-BundleShape: dir' into the MANIFEST.MF for org.eclipse.m2e.wtp, then symlink the system jar for maven-war-plugin matching the name listed in Bundle-ClassPath, the build should work. The purpose of adding that attribute above is to avoid packaging the plugin as a jar, with an embedded jar, which is against guidelines. I think you'd probably have to re-symlink the jar for %%install as well.
Cheers,
On 03/02/2015 04:08 PM, Roland Grunberg wrote:
There may be a workaround you could try that would avoid having to OSGi-ify maven-war-plugin. If you add the attribute 'Eclipse-BundleShape: dir' into the MANIFEST.MF for org.eclipse.m2e.wtp, then symlink the system jar for maven-war-plugin matching the name listed in Bundle-ClassPath, the build should work. The purpose of adding that attribute above is to avoid packaging the plugin as a jar, with an embedded jar, which is against guidelines. I think you'd probably have to re-symlink the jar for %%install as well.
The workaround works, thanks! The build gets much further now. I'm running into the next issue now. A stack trace from Tycho. Could that be due to the different Tycho version? I would not expect an exception like that in this case though, so it seems like a peculiarity in the packaging process to me.
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-plugin:0.21.0:p2-metadata (attach-p2-metadata) on project org.eclipse.m2e.wtp.jaxrs.feature: Execution attach-p2-metadata of goal org.eclipse.tycho:tycho-p2-plugin:0.21.0:p2-metadata failed. IllegalArgumentException -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-p2-plugin:0.21.0:p2-metadata (attach-p2-metadata) on project org.eclipse.m2e.wtp.jaxrs.feature: Execution attach-p2-metadata of goal org.eclipse.tycho:tycho-p2-plugin:0.21.0:p2-metadata failed. at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213) at org.apache.maven.cli.MavenCli.main(MavenCli.java:157) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.PluginExecutionException: Execution attach-p2-metadata of goal org.eclipse.tycho:tycho-p2-plugin:0.21.0:p2-metadata failed. at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 19 more Caused by: java.lang.IllegalArgumentException at org.eclipse.tycho.p2.impl.publisher.P2GeneratorImpl.getCanonicalArtifact(P2GeneratorImpl.java:156) at org.eclipse.tycho.p2.impl.publisher.P2GeneratorImpl.generateMetadata(P2GeneratorImpl.java:109) at org.eclipse.tycho.plugins.p2.P2MetadataMojo.attachP2Metadata(P2MetadataMojo.java:141) at org.eclipse.tycho.plugins.p2.P2MetadataMojo.execute(P2MetadataMojo.java:102) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132) ... 20 more
I'm getting a bit further again with the m2e-wtp build. Disabling the things with seem mostly relevant for the update site allowed the build to progress.
Roland Grunberg wrote:
There may be a workaround you could try that would avoid having to OSGi-ify maven-war-plugin. If you add the attribute 'Eclipse-BundleShape: dir' into the MANIFEST.MF for org.eclipse.m2e.wtp, then symlink the system jar for maven-war-plugin matching the name listed in Bundle-ClassPath, the build should work. The purpose of adding that attribute above is to avoid packaging the plugin as a jar, with an embedded jar, which is against guidelines. I think you'd probably have to re-symlink the jar for %%install as well.
It seems there is still a problem with this workaround. I'm facing the error from XMvn that I should remove all dependencies with the scope system. It mentions the maven-war-plugin-2.1.1.jar, which I symlinked. The dependency section of this plugin doesn't have a scope specified, should I add one to make this work? Is situation occurring also with other builds?
Thanks, Julius
Il 15/03/2015 00:03, Julius Schwartzenberg ha scritto:
I'm getting a bit further again with the m2e-wtp build. Disabling the things with seem mostly relevant for the update site allowed the build to progress.
Roland Grunberg wrote:
There may be a workaround you could try that would avoid having to OSGi-ify maven-war-plugin. If you add the attribute 'Eclipse-BundleShape: dir' into the MANIFEST.MF for org.eclipse.m2e.wtp, then symlink the system jar for maven-war-plugin matching the name listed in Bundle-ClassPath, the build should work. The purpose of adding that attribute above is to avoid packaging the plugin as a jar, with an embedded jar, which is against guidelines. I think you'd probably have to re-symlink the jar for %%install as well.
hi, Bundle-ClassPath (as for Class-Path) is not allowed in Fedora. You should (read must) remove this instruction from felix (or war plugin) regards gil
It seems there is still a problem with this workaround. I'm facing the error from XMvn that I should remove all dependencies with the scope system. It mentions the maven-war-plugin-2.1.1.jar, which I symlinked. The dependency section of this plugin doesn't have a scope specified, should I add one to make this work? Is situation occurring also with other builds?
Thanks, Julius -- java-devel mailing list java-devel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/java-devel
On 03/15/2015 02:07 AM, gil wrote:
Il 15/03/2015 00:03, Julius Schwartzenberg ha scritto:
I'm getting a bit further again with the m2e-wtp build. Disabling the things with seem mostly relevant for the update site allowed the build to progress.
Roland Grunberg wrote:
There may be a workaround you could try that would avoid having to OSGi-ify maven-war-plugin. If you add the attribute 'Eclipse-BundleShape: dir' into the MANIFEST.MF for org.eclipse.m2e.wtp, then symlink the system jar for maven-war-plugin matching the name listed in Bundle-ClassPath, the build should work. The purpose of adding that attribute above is to avoid packaging the plugin as a jar, with an embedded jar, which is against guidelines. I think you'd probably have to re-symlink the jar for %%install as well.
Bundle-ClassPath (as for Class-Path) is not allowed in Fedora. You should (read must) remove this instruction from felix (or war plugin)
Doesn't this mean that maven-war-plugin still needs to be OSGI-ified? I understand this would mean creating a new version of the maven-war-plugin RPM in which the spec file patches the pom files to use Felix to OSGI-ify it?
Thanks, Julius
On 03/15/2015 02:07 AM, gil wrote:
Il 15/03/2015 00:03, Julius Schwartzenberg ha scritto:
I'm getting a bit further again with the m2e-wtp build. Disabling the things with seem mostly relevant for the update site allowed the build to progress.
Roland Grunberg wrote:
There may be a workaround you could try that would avoid having to OSGi-ify maven-war-plugin. If you add the attribute 'Eclipse-BundleShape: dir' into the MANIFEST.MF for org.eclipse.m2e.wtp, then symlink the system jar for maven-war-plugin matching the name listed in Bundle-ClassPath, the build should work. The purpose of adding that attribute above is to avoid packaging the plugin as a jar, with an embedded jar, which is against guidelines. I think you'd probably have to re-symlink the jar for %%install as well.
Bundle-ClassPath (as for Class-Path) is not allowed in Fedora. You should (read must) remove this instruction from felix (or war plugin)
Doesn't this mean that maven-war-plugin still needs to be OSGI-ified? I understand this would mean creating a new version of the maven-war-plugin RPM in which the spec file patches the pom files to use Felix to OSGI-ify it?
Sorry for the delay,
I just asked Mat Booth about this and it seems you should be fine to use Bundle-ClassPath. In fact, the Eclipse plugin packaging guidelines refer to this exact case [1].
Initially I thought [2] implied Bundle-ClassPath, especially since it's not a preferred way of doing things. However, I forgot that there are some cases where Bundle-ClassPath is the only way of achieving certain functionality (eg. various nested jars that are built from sources in platform/independent plugins).
Cheers,
On 03/18/2015 09:11 PM, Roland Grunberg wrote:
On 03/15/2015 02:07 AM, gil wrote:
Bundle-ClassPath (as for Class-Path) is not allowed in Fedora. You should (read must) remove this instruction from felix (or war plugin)
I just asked Mat Booth about this and it seems you should be fine to use Bundle-ClassPath. In fact, the Eclipse plugin packaging guidelines refer to this exact case [1].
Initially I thought [2] implied Bundle-ClassPath, especially since it's not a preferred way of doing things. However, I forgot that there are some cases where Bundle-ClassPath is the only way of achieving certain functionality (eg. various nested jars that are built from sources in platform/independent plugins).
Does that also mean I should leave the existing jar in place or is there a way to make the symlink work? I'm not really sure about the appropriate way to get around the XMvn error now.
Thanks, Julius
On 19 March 2015 at 08:28, Julius Schwartzenberg < julius.schwartzenberg@abz.nl> wrote:
On 03/18/2015 09:11 PM, Roland Grunberg wrote:
On 03/15/2015 02:07 AM, gil wrote:
Bundle-ClassPath (as for Class-Path) is not allowed in Fedora. You should (read must) remove this instruction from felix (or war
plugin)
I just asked Mat Booth about this and it seems you should be fine to use Bundle-ClassPath. In fact, the Eclipse plugin packaging guidelines refer to this exact case [1].
Initially I thought [2] implied Bundle-ClassPath, especially since it's
not
a preferred way of doing things. However, I forgot that there are some
cases
where Bundle-ClassPath is the only way of achieving certain
functionality (eg.
various nested jars that are built from sources in platform/independent plugins).
Does that also mean I should leave the existing jar in place or is there a way to make the symlink work? I'm not really sure about the appropriate way to get around the XMvn error now.
Thanks, Julius -- java-devel mailing list java-devel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/java-devel
Can you post the exact error you are seeing or your spec file so far?
On 03/19/2015 10:17 AM, Mat Booth wrote:
On 19 March 2015 at 08:28, Julius Schwartzenberg <julius.schwartzenberg@abz.nl mailto:julius.schwartzenberg@abz.nl> wrote:
On 03/18/2015 09:11 PM, Roland Grunberg wrote: >> On 03/15/2015 02:07 AM, gil wrote: >>> Bundle-ClassPath (as for Class-Path) is not allowed in Fedora. >>> You should (read must) remove this instruction from felix (or war plugin) > I just asked Mat Booth about this and it seems you should be fine to use > Bundle-ClassPath. In fact, the Eclipse plugin packaging guidelines refer > to this exact case [1].
Can you post the exact error you are seeing or your spec file so far?
I've attached my spec file.
Here is the error: [ERROR] Reactor project org.eclipse.m2e.wtp:org.eclipse.m2e.wtp:jar:1.1.0-SNAPSHOT has system-scoped dependencies: [
org.eclipse.m2e.wtp:org.eclipse.m2e.wtp:jars/maven-war-plugin-2.1.1.jar:jar:1.1.0.qualifier,
org.eclipse.m2e.wtp:org.eclipse.m2e.wtp.source:jars/maven-war-plugin-2.1.1.jar:jar:1.1.0.qualifier ] [ERROR] Reactor project org.eclipse.m2e.wtp:org.eclipse.m2e.wtp.feature:jar:1.1.0-SNAPSHOT has system-scoped dependencies: [
org.eclipse.m2e.wtp:org.eclipse.m2e.wtp:jars/maven-war-plugin-2.1.1.jar:jar:1.1.0.qualifier ] [ERROR] Reactor project org.eclipse.m2e.wtp:org.eclipse.m2e.wtp.jaxrs:jar:1.1.0-SNAPSHOT has system-scoped dependencies: [
org.eclipse.m2e.wtp:org.eclipse.m2e.wtp:jars/maven-war-plugin-2.1.1.jar:jar:1.1.0.qualifier ] [ERROR] Reactor project org.eclipse.m2e.wtp:org.eclipse.m2e.wtp.jaxrs.feature:jar:1.1.0-SNAPSHOT has system-scoped dependencies: [
org.eclipse.m2e.wtp:org.eclipse.m2e.wtp:jars/maven-war-plugin-2.1.1.jar:jar:1.1.0.qualifier ] [ERROR] Reactor project org.eclipse.m2e.wtp:org.eclipse.m2e.wtp.jsf:jar:1.1.0-SNAPSHOT has system-scoped dependencies: [
org.eclipse.m2e.wtp:org.eclipse.m2e.wtp:jars/maven-war-plugin-2.1.1.jar:jar:1.1.0.qualifier ] [ERROR] Reactor project org.eclipse.m2e.wtp:org.eclipse.m2e.wtp.jsf.feature:jar:1.1.0-SNAPSHOT has system-scoped dependencies: [
org.eclipse.m2e.wtp:org.eclipse.m2e.wtp:jars/maven-war-plugin-2.1.1.jar:jar:1.1.0.qualifier ] [ERROR] Reactor project org.eclipse.m2e.wtp:org.eclipse.m2e.wtp.sdk.feature:jar:1.1.0-SNAPSHOT has system-scoped dependencies: [
org.eclipse.m2e.wtp:org.eclipse.m2e.wtp:jars/maven-war-plugin-2.1.1.jar:jar:1.1.0.qualifier,
org.eclipse.m2e.wtp:org.eclipse.m2e.wtp.source:jars/maven-war-plugin-2.1.1.jar:jar:1.1.0.qualifier ] [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] M2E-WTP :: Parent .................................. FAILURE [ 0.271 s] [INFO] M2E-WTP :: Overlay Core ............................ SUCCESS [ 3.383 s] [INFO] M2E-WTP :: Overlay UI .............................. SUCCESS [ 0.570 s] [INFO] M2E-WTP :: Core .................................... SUCCESS [ 2.689 s] [INFO] M2E-WTP :: Core Feature ............................ SUCCESS [ 0.628 s] [INFO] M2E-WTP :: JAX-RS Support .......................... SUCCESS [ 0.872 s] [INFO] M2E-WTP :: JAX-RS Support Feature .................. SUCCESS [ 0.286 s] [INFO] M2E-WTP :: JSF Support ............................. SUCCESS [ 0.865 s] [INFO] M2E-WTP :: JSF Support Feature ..................... SUCCESS [ 0.299 s] [INFO] M2E-WTP :: Core SDK Feature (Optional) ............. SUCCESS [ 0.224 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 54.976 s [INFO] Finished at: 2015-03-14T23:52:28+01:00 [INFO] Final Memory: 47M/112M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.fedoraproject.xmvn:xmvn-mojo:2.0.1:install (default-cli) on project org.eclipse.m2e.wtp.parent: Some reactor artifacts have dependencies with scope "system". Such dependencies are not supported by XMvn installer. You should either remove any dependencies with scope "system" before the build or not run XMvn instaler. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException error: Bad exit status from /var/tmp/rpm-tmp.L8QMxe (%build)
Can you post the exact error you are seeing or your spec file so far?
I've attached my spec file.
Here is the error: [ERROR] Reactor project org.eclipse.m2e.wtp:org.eclipse.m2e.wtp:jar:1.1.0-SNAPSHOT has system-scoped dependencies: [
org.eclipse.m2e.wtp:org.eclipse.m2e.wtp:jars/maven-war-plugin-2.1.1.jar:jar:1.1.0.qualifier,
org.eclipse.m2e.wtp:org.eclipse.m2e.wtp.source:jars/maven-war-plugin-2.1.1.jar:jar:1.1.0.qualifier ]
.. ..
[ERROR] Failed to execute goal org.fedoraproject.xmvn:xmvn-mojo:2.0.1:install (default-cli) on project org.eclipse.m2e.wtp.parent: Some reactor artifacts have dependencies with scope "system". Such dependencies are not supported by XMvn installer. You should either remove any dependencies with scope "system" before the build or not run XMvn instaler. -> [Help 1]
Try adding '%pom_remove_dep :maven-war-plugin org.eclipse.m2e.wtp' to the %prep section of your specfile. This should resolve the issue. The dependency is already being set up properly by your symlink, manifest, and build.properties.
Cheers,
On 03/19/2015 04:05 PM, Roland Grunberg wrote:
[ERROR] Failed to execute goal org.fedoraproject.xmvn:xmvn-mojo:2.0.1:install (default-cli) on project org.eclipse.m2e.wtp.parent: Some reactor artifacts have dependencies with scope "system". Such dependencies are not supported by XMvn installer. You should either remove any dependencies with scope "system" before the build or not run XMvn instaler. -> [Help 1]
Try adding '%pom_remove_dep :maven-war-plugin org.eclipse.m2e.wtp' to the %prep section of your specfile. This should resolve the issue. The dependency is already being set up properly by your symlink, manifest, and build.properties.
That removes the dependency from the pom file (there's no other pom file which has this dependency specified), but I still get the errors. Does XMvn use other checks as well?
Thanks, Julius
On 03/19/2015 04:05 PM, Roland Grunberg wrote:
[ERROR] Failed to execute goal org.fedoraproject.xmvn:xmvn-mojo:2.0.1:install (default-cli) on project org.eclipse.m2e.wtp.parent: Some reactor artifacts have dependencies with scope "system". Such dependencies are not supported by XMvn installer. You should either remove any dependencies with scope "system" before the build or not run XMvn instaler. -> [Help 1]
Try adding '%pom_remove_dep :maven-war-plugin org.eclipse.m2e.wtp' to the %prep section of your specfile. This should resolve the issue. The dependency is already being set up properly by your symlink, manifest, and build.properties.
That removes the dependency from the pom file (there's no other pom file which has this dependency specified), but I still get the errors. Does XMvn use other checks as well?
I'm running into the same thing on F21, but can I can build your project on rawhide (fails in %install).
This looks like a restriction in Xmvn that has been lifted in f22/rawhide likely due to better support. XMvn seems to think that the maven-war-plugin you've symlinked is an artifact generated from the org.eclipse.m2e.wtp plugin but fails because it isn't actually injected by Tycho at all.
If eclipse-m2e-core ran into the same problem, my guess is the workaround can be found in the spec [1]. Otherwise I would probably just try building with plain 'xmvn' and package the necessary contents manually. Building for rawhide, and F22 should be less problematic.
Cheers,
The issue is related to something else, but the reason this wouldn't have worked is because your maven rpm build would resolve the version of Fedora installed on your system (through rpm).
I re-read this and realized I made an error. It makes actual sense if you replace Fedora with Tycho.
In other fedora packages we just remove the jgit dependencies, for example see eclipse-mylyn.spec lines 243-246:
http://pkgs.fedoraproject.org/cgit/eclipse-mylyn.git/tree/eclipse-mylyn.spec...
I think this is an acceptible workaround
We even do this for things like the Eclipse platform build. I'm thinking of adding an entry about this at http://fedoraproject.org/wiki/Tycho given that this difference will always exist for Eclipse packages. Upstream foundation projects will almost always build from a cloned repo (though they don't often enable the jgit source referencing capability) and in Fedora we'll always get the sources without the git repo metadata.
Cheers,
On 02/20/2015 01:45 PM, Julius Schwartzenberg wrote:
I added a few more dependencies and now I'm running into this error:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:0.21.0:package-plugin (default-package-plugin) on project org.eclipse.m2e.wtp.overlay: Execution default-package-plugin of goal org.eclipse.tycho:tycho-packaging-plugin:0.21.0:package-plugin failed: One of setGitDir or setWorkTree must be called. -> [Help 1]
Is this related to these %global lines at the top? I wasn't sure what to do with them.
This is a bug in tycho-extras. I've just filed it: https://bugzilla.redhat.com/show_bug.cgi?id=1196167
As workaround you can add to %prep: %pom_remove_plugin :tycho-packaging-plugin
java-devel@lists.fedoraproject.org