This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 189600 - Unable to run bundle in Felix using M3 - param quoting issue
Summary: Unable to run bundle in Felix using M3 - param quoting issue
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: All Unix
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
: 189990 (view as bug list)
Depends on: 190357
Blocks:
  Show dependency tree
 
Reported: 2010-08-17 14:27 UTC by Tomas Danek
Modified: 2010-09-14 13:11 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Danek 2010-08-17 14:27:54 UTC
maven dev #203
---------------
- Created maven osgi bundle
- created bundle activator
- clean and build
- run fails, seems like some properties don't get resolved--->

NetBeans: Executing '/Users/tomas/Downloads/netbeans/java/maven/bin/mvn -Dexec.args=-Dfelix.system.properties=file:'${project.build.directory}/run.properties' -cp '${project.build.directory}/felix.jar' org.apache.felix.main.Main -Dexec.executable=java -Dnetbeans.execution=true -Prun-on-felix package org.codehaus.mojo:exec-maven-plugin:1.1.1:exec'
NetBeans:      JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
/Users/tomas/Downloads/netbeans/java/maven/bin/mvn: line 164: -Dexec.args=-Dfelix.system.properties=file:'${project.build.directory}/run.properties' -cp '${project.build.directory}/felix.jar' org.apache.felix.main.Main: bad substitution
Comment 1 Jesse Glick 2010-08-17 15:24:23 UTC
I get the same attempting to run the same command using Maven 2 from the command line, though it is hard to tell what exactly I am supposed to run since there are so many parameters with internal quoting. Finally I can get to the right command line for bash (after manually substituting the project directory!):

mvn -Dmaven.test.skip=true -Dexec.args='-Dfelix.system.properties=file:.../target/run.properties -cp .../target/felix.jar org.apache.felix.main.Main' -Dexec.executable=java -Dnetbeans.execution=true -Ddebug.YUI=false -Prun-on-felix package org.codehaus.mojo:exec-maven-plugin:1.1.1:exec

The same seems to work with Maven 3 so there may be some difference in how NB is quoting parameters.

It is surprising that running bundles ever worked at all; the archetype is a complete mess and existing projects made with it are not going to be supportable.
Comment 2 Jesse Glick 2010-08-17 15:53:59 UTC
In fact this is easily reproducible in non-maven-dev builds just by using Maven 3 to run. http://jira.codehaus.org/browse/MNG-3529 seems to be responsible. Likely specific to Unix systems.

Passing around parameters with embedded spaces and quotes and so forth is inherently fragile and likely to cause platform-specific problems. The real fix would be to change the archetype to not stuff complex commands into the POM, reserving logic like this for a properly maintained plugin.
Comment 3 Jesse Glick 2010-08-17 16:50:29 UTC
Regression in the Maven launcher: http://jira.codehaus.org/browse/MNG-4767
Comment 4 Quality Engineering 2010-08-19 03:23:37 UTC
Integrated into 'main-golden', will be available in build *201008190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/88941f2af5ba
User: Jesse Glick <jglick@netbeans.org>
Log: Better, but far from perfect,way of displaying complex command lines. See #189600.
Comment 5 Antonin Nebuzelsky 2010-08-31 09:35:48 UTC
*** Bug 189990 has been marked as a duplicate of this bug. ***