Issue Details (XML | Word | Printable)

Key: MNBMODULE-45
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Milos Kleint
Reporter: Johan Andrén
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Maven 2.x Netbeans Module Plugin

nbm:run-platform not working on unix

Created: 09/Mar/09 08:02 AM   Updated: 10/Mar/09 08:32 AM
Component/s: None
Affects Version/s: 3.0
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide

When we run nbm:run-platform on our platform application on osx we get the following error:
{{
[nbm:run-platform]
Executing: /bin/sh -c /Users/johan/NetBeansProjects/prosang/trunk/client/prosang/target/prosang/bin/prosang
sh: /Users/johan/NetBeansProjects/prosang/trunk/client/prosang/target/prosang/bin/../platform*/lib/nbexec: No such file or directory
}}

this is because of the netbeans-platform executable on unixes are actually a script, containing this:
{{
...
PRG=$0
...

...
progdir=`dirname "$PRG"`
...

...
nbexec=`echo "$progdir"/../platform*/lib/nbexec`
...
}}

so $progdir will always point to the projectdir/target/application-name/ directory where no lib directory exists.
(Or do we need to create that ourselves somehow?)



Johan Andrén added a comment - 09/Mar/09 08:10 AM

Clarification:

The netbeans app bash script will look under target/appname/platform*/lib/ for the nbexec binary


Johan Andrén added a comment - 09/Mar/09 08:39 AM

After running nbm:cluster-app I have to copy the following files manually to the corresponding places under target to make nbm:run-platform work:

$NB_INSTALLATION/platform9/lib/nbexec
$NB_INSTALLATION/platform9/lib/boot.jar
$NB_INSTALLATION/plafrom9/core/core.jar


Milos Kleint added a comment - 09/Mar/09 08:43 AM

what repository are you using for the assembly of the application? did you generate it yourself? with what version of nbm-maven-plugin?


Johan Andrén added a comment - 09/Mar/09 08:48 AM

nbm-maven-plugin version:3.0
repository: http://bits.netbeans.org/maven2/
nb rcp: RELEASE65


Milos Kleint added a comment - 09/Mar/09 08:55 AM

and by unix (in issue summary) you mean MAC OSX alone or is it also not working on linux?


Johan Andrén added a comment - 09/Mar/09 09:03 AM

I have not tried it on Linux but it should be the same netbeans-start-script so I cannot se how it could work on any unix flavour.


Johan Andrén added a comment - 10/Mar/09 05:03 AM

We added org-netbeans-core-windows as a dependency to our nbm-application project and the missing came with either that dependency or one of the transitive dependencies from the module.

Problem solved.


Milos Kleint added a comment - 10/Mar/09 05:12 AM

what dependencies did you have with the nbm-application project? the boot.jar and core.jar shall be on the platform cluster pom's dependency set. if not the populate-repository goal has a problem.


Johan Andrén added a comment - 10/Mar/09 07:51 AM

We only had transitive dependencies from our application modules.
When we added these two dependencies to the app it worked:
<dependency>
<groupId>org.netbeans.modules</groupId>
<artifactId>org-netbeans-core-windows</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.modules</groupId>
<artifactId>org-netbeans-modules-editor-mimelookup-impl</artifactId>
</dependency>

I would guess that core-windows has dependencies on core and bootstrap.

When I look at the library view in netbeans/mevenide i cannot find core.jar or boot.jar even though it now works. org-netbeans-bootstrap.jar and org-netbeans-core.jar are among the dependencies though.


Milos Kleint added a comment - 10/Mar/09 08:32 AM

well, relying on transitive dependencies only is not 100% bulletproof (as you figured) there are modules that are required by the running application but which are not reachable by transitivity. These typically provide implementations of services defined in other api modules. core-windows is a nice example. no module depends on it, but it's crucial to the running app as it implements the window system.

a safer way to define what your application is composed of is it declare dependency on the whole cluster (org.netbeans.clusters groupid) and then eventually selectively exclude stuff you don't want at runtime..