Maven NetBeans Module Plugin

nbm:run-platform not working on unix

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Not A Bug
  • Affects Version/s: 3.0
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

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?)

Activity

Hide
Johan Andrén added a comment -

Clarification:

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

Show
Johan Andrén added a comment - Clarification: The netbeans app bash script will look under target/appname/platform*/lib/ for the nbexec binary
Hide
Johan Andrén added a comment -

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

Show
Johan Andrén added a comment - 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
Hide
Milos Kleint added a comment -

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

Show
Milos Kleint added a comment - what repository are you using for the assembly of the application? did you generate it yourself? with what version of nbm-maven-plugin?
Hide
Johan Andrén added a comment -

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

Show
Johan Andrén added a comment - nbm-maven-plugin version:3.0 repository: http://bits.netbeans.org/maven2/ nb rcp: RELEASE65
Hide
Milos Kleint added a comment -

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

Show
Milos Kleint added a comment - and by unix (in issue summary) you mean MAC OSX alone or is it also not working on linux?
Hide
Johan Andrén added a comment -

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.

Show
Johan Andrén added a comment - 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.
Hide
Johan Andrén added a comment -

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.

Show
Johan Andrén added a comment - 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.
Hide
Milos Kleint added a comment -

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.

Show
Milos Kleint added a comment - 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.
Hide
Johan Andrén added a comment -

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.

Show
Johan Andrén added a comment - 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.
Hide
Milos Kleint added a comment -

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..

Show
Milos Kleint added a comment - 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..
Hide
Jesse Glick added a comment -

As Miloš says, NB Platform apps can have implicit dependencies on modules that provide essential services. http://wiki.netbeans.org/ModuleSystemModestProposal#Provide-require_dependencies_and_.22build_with_dependencies.22_action touches on this issue. For now you simply need to include enough core modules in your app, if you are not including the entire cluster.

Show
Jesse Glick added a comment - As Miloš says, NB Platform apps can have implicit dependencies on modules that provide essential services. http://wiki.netbeans.org/ModuleSystemModestProposal#Provide-require_dependencies_and_.22build_with_dependencies.22_action touches on this issue. For now you simply need to include enough core modules in your app, if you are not including the entire cluster.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: