Re: Packaging m2e-wtp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
Name:           eclipse-m2e-wtp
Version:        1.1.0
Release:        0.1.git%{shortcommit}%{?dist}
Summary:        M2E-WTP
License:        EPL
URL:            https://github.com/eclipse/m2e.wtp/
BuildArch:      noarch

#Source0:        https://github.com/eclipse/m2e.wtp/archive/releases/1.1.0/1.1.0.20140611-1646.tar.gz
Source0:        https://github.com/eclipse/m2e.wtp/archive/releases/1.1.0/m2e.wtp-releases-1.1.0-1.1.0.20140611-1646.tar.gz

#Patch0:         m2e.wtp-releases-1.1.0-1.1.0.20140611-1646-tycho_v0.21.0.patch

BuildRequires:  eclipse-license
BuildRequires:  eclipse-m2e-mavenarchiver
BuildRequires:  eclipse-webtools-jsf
BuildRequires:  maven-local
BuildRequires:  mvn(io.tesla.tycho:tycho-support:pom:)
BuildRequires:  mvn(org.apache.maven.plugins:maven-war-plugin:pom:)
BuildRequires:  osgi(org.eclipse.core.resources)
BuildRequires:  osgi(org.eclipse.core.runtime)
BuildRequires:  osgi(org.eclipse.m2e.core)
BuildRequires:  osgi(org.eclipse.m2e.jdt)
BuildRequires:  osgi(org.eclipse.m2e.maven.runtime)
BuildRequires:  osgi(slf4j.api)
BuildRequires:  tycho

%description
This package provides WTP support for Eclipse M2E.

%prep
%setup -q -n m2e.wtp-releases-1.1.0-1.1.0.20140611-1646
find -name *.jar -delete

# Fedora has newer version of M2E.  Relax bundle version requirements.
sed -i 's/\[1.0.0,1.2.0)/[1.0.0,2.0.0)/' $(find -name *.MF)
# SLF4J in Fedora uses a different BSN
sed -i s/org.slf4j.api/slf4j.api/ $(find -name *.MF)

# Use default buildtimestamp source
%pom_remove_dep :tycho-sourceref-jgit .
sed -i -e "/<sourceReferences>/,+2d" pom.xml

# Use system maven-war-plugin which is not OGSI-ified instead of included (and above deleted) OGSI-ified version
echo "Eclipse-BundleShape: dir" >> org.eclipse.m2e.wtp/META-INF/MANIFEST.MF
ln -s /usr/share/java/maven-war-plugin/maven-war-plugin.jar org.eclipse.m2e.wtp/jars/maven-war-plugin-2.1.1.jar

%build
%mvn_build -j -- -X

%install
%mvn_install

%files -f .mfiles
%doc org.sonatype.m2e.wtp/about.html

%changelog
* Fri Feb 20 2015 Julius Schwartzenberg <julius.schwartzenberg@xxxxxxxxx> - 1.1.0-0.1.
- Initial commit
--
java-devel mailing list
java-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/java-devel

[Index of Archives]     [Red Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux