org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o rg.apache.maven.plugins:maven-jar-plugin:2.6:jar (default-jar) on project ac-ucm -portlet: Error assembling JAR

Liferay Issues | Neil Griffin | 12 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    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}

    Liferay Issues | 12 months ago | Neil Griffin
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o rg.apache.maven.plugins:maven-jar-plugin:2.6:jar (default-jar) on project ac-ucm -portlet: Error assembling JAR
  2. 0

    GitHub comment 65#205039580

    GitHub | 11 months ago | MrMindlink
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources (default-resources) on project sample-java-client: /home/pi/Downloads/alexa-avs-raspberry-pi-master/samples/javaclient/target/classes/res/version.properties (Permission denied)
  3. 0

    External authentication compatibility with Analysis Execution

    Google Groups | 11 months ago | JYCr
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (global-quality) on project foo-project: You're not authorized to execute any SonarQube analysis. Please contact your SonarQube administrator.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    How do I clear this address so that is is no longer "already in use"?

    Stack Overflow | 9 months ago | Kyle Souza
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.3.9.v20160517:run (default-cli) on project dashboard-builder: Failure
  6. 0

    [Blue Ocean] Build failure when compiling BlueOcean on a Windows 10 machine

    Google Groups | 9 months ago | Unknown author
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jenkins-ci.tools:maven-hpi-plugin:1.117:test-hpl (default-test-hpl) on project blueocean: Error preparing the manifest: Failed to open artifact org.jenkins-ci.plugins.workflow:workflow-scm-step:jar:1.15:compile at C:\Users\kazaky\.m2\repository\org\jenkins-ci\plugins\workflow\workflow-scm-step\1.15\workflow-scm-step-1.15.jar

  1. davidvanlaatum 2 times, last 5 months ago
31 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.apache.maven.lifecycle.LifecycleExecutionException

    Failed to execute goal o rg.apache.maven.plugins:maven-jar-plugin:2.6:jar (default-jar) on project ac-ucm -portlet: Error assembling JAR

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute()
  2. Maven Core
    DefaultMaven.execute
    1. org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    2. org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    3. org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    4. org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    5. org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    6. org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    7. org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    8. org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    9. org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    10. org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    10 frames
  3. M3 Interceptor
    MavenCli.main
    1. org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    2. org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    3. org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    3 frames
  4. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:498)
    4 frames