org.apache.maven.lifecycle.LifecycleExecutionException

tip

Change the in pom.xml to use xml parameters instead of the list.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • GitHub comment 65#205039580
    via GitHub by MrMindlink
    ,
  • mvn-all.sh script fails with
    via by Gal Nitzan,
  • h3. Steps to Reproduce: 1. Start Liferay Portal 7.0.0 B8 2. Clone the [blade|https://github.com/rotty3000/blade] Git repository. 3. Navigate to the blade.portlet.jsp Maven project: {code}cd blade/maven/blade.portlet.jsp{code} 4. Create the following package: {code}mkdir src/main/java/blade/portlet/jsp/stuff{code} 5. Create the following Java classes in the package; {code:java} package blade.portlet.jsp.stuff; public class Foo { } {code} {code:java} package blade.portlet.jsp.stuff; public class Bar { } {code} 6. Replace src/main/resources/META-INF/resources/view.jsp with the following contents: {code:html} <%@ include file="/init.jsp" %> <%@ page import="blade.portlet.jsp.stuff.*, java.lang.Boolean, java.util.ArrayList" %> <% Foo foo = new Foo(); ArrayList<String> myList = new ArrayList<String>(); %> <p>boolean=<%= Boolean.TRUE.toString() %></p> <p>myList=<%= myList.toString() %></p> {code} 7. Build the OSGi bundle: {code}mvn clean package{code} 8. Deploy the OSGi bundle: {code}cp target/blade.portlet.jsp-1.0.0.jar $LIFERAY_HOME/osgi/modules{code} If the bug is fixed, then the OSGi bundle will deploy properly. Otherwise, if the bug still exists, then the following stacktrace will appear in the server log: {noformat} 22:50:22,018 WARN [fileinstall-/Users/ngriffin/Portals/liferay.com/liferay-portal-7.0.0-SNAPSHOT-jsf-2.2/osgi/modules][org_apache_felix_fileinstall:102] Failed to update artifact /Users/ngriffin/Portals/liferay.com/liferay-portal-7.0.0-SNAPSHOT-jsf-2.2/osgi/modules/blade.portlet.jsp-1.0.0.jar org.osgi.framework.BundleException: Invalid manifest header Import-Package: "java.lang.Boolean" : Cannot specify java.* packages in Import/Export headers "java.lang.Boolean" at org.eclipse.osgi.container.builders.OSGiManifestBuilderFactory.checkImportExportSyntax(OSGiManifestBuilderFactory.java:147) at org.eclipse.osgi.container.builders.OSGiManifestBuilderFactory.validateHeaders(OSGiManifestBuilderFactory.java:118) at org.eclipse.osgi.container.builders.OSGiManifestBuilderFactory.createBuilder(OSGiManifestBuilderFactory.java:78) at org.eclipse.osgi.container.builders.OSGiManifestBuilderFactory.createBuilder(OSGiManifestBuilderFactory.java:56) at org.eclipse.osgi.storage.Storage.getBuilder(Storage.java:589) at org.eclipse.osgi.storage.Storage.update(Storage.java:714) at org.eclipse.osgi.internal.framework.EquinoxBundle.update(EquinoxBundle.java:448) at org.apache.felix.fileinstall.internal.DirectoryWatcher.update(DirectoryWatcher.java:1133) at org.apache.felix.fileinstall.internal.DirectoryWatcher.update(DirectoryWatcher.java:905) at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:484) at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361) at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:313) {noformat} h3. Workaround: - Do not use comma-delimited lists of imports - Instead, use one {{<%@ page import="..." %>}} per line - Do not use wildcards, but instead specify each class individually h3. Observations: 1. In the JSP from step#6, the {{blade.portlet.jsp.stuff.*}} import is not actually necessary, since Bar.java is not used anywhere in the JSP. However, placing it in its own page directive makes the error go away: {code:html} <%@ page import="blade.portlet.jsp.stuff.*" %> <%@ page import="java.lang.Boolean, java.util.ArrayList" %> {code} 2. In the JSP from step#6, if the {{blade.portlet.jsp.stuff.\*}} import is replaced by {{java.net.\*}} then it works. Why does the first unused wildcard cause a problem, and the second does not? 3. The following JSP *should* work fine because Foo.java is used in the JSP, but it fails: {code:html} <%@ page import="blade.portlet.jsp.stuff.Foo, java.util.*, java.lang.Boolean" %> <% Foo foo = new Foo(); ArrayList<String> myList = new ArrayList<String>(); %> <p>boolean=<%= Boolean.TRUE.toString() %></p> <p>myList=<%= myList.toString() %></p> {code} ... error message is: {noformat} Invalid manifest header Import-Package: "java.util.*" : Cannot specify java.* packages in Import/Export headers "java.util.*" {noformat}
    via by Neil Griffin,
    • org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o rg.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on p roject GLSLib: Compilation failure at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) 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:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) 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:498)

    Users with the same issue

    davidvanlaatumdavidvanlaatum
    2 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    40 more bugmates