简体   繁体   中英

Netbeans won't let me change a project's Netbeans platform

I've downloaded the VisualVM source and am trying to compile the Glassfish plugin using Netbeans 7.01. Doing so results in the following error:

C:\\source\\visualvm\\trunk\\plugins\\glassfish\\nbproject\\build-impl.xml:48: You must define 'nbplatform.VisualVM_100609-dd12ae64a19c.harness.dir'

That lead me to the project settings which shows the platform as "Netbeans IDE...". The drop down box is grayed out so I can't select the correct platform. 在此输入图像描述

Yet, on my hello world VisualVM plugin I can set the platform to the appropriate platform and it runs great. 在此输入图像描述

To try and resolve this I've tried creating platform.properties file and putting it in the nbproject folder with the following entries. However, this doesn't seem to be working

harness.dir=mypath/visualvm/visualvm_13

and

nbplatform.VisualVM_100609-dd12ae64a19c.harness.dir=mypath/visualvm/visualvm_13

Any suggestions.

Glassfish plugin is part of 'plugins' NetBeans modules suite. All modules from a Modules suite has to be build against the same version of NetBeans platform application (in our case VisualVM). This means that you can change the NetBeans Platform for the whole suite, go to the properties of the 'plugins' suite a change the platform there.

In order to build the VisualVM and it's associated plugins you must download the NetBeans platform and profiler binaries that are available on the VisualVM website's build guide section .

For example, to build the 1.3.2 release you would go to this section and download the NetBeans 6.9.1 platform and profiler binaries available through the link located on that page. The link I've provided also gives you instructions for obtaining the proper VisualVM sources from the repository and building VisualVM and it's plugins. For example, the sources for the 1.3.2 release can be checked out using the following url:

https://svn.java.net/svn/visualvm~svn/branches/release132

And once you've completed the checkout and extracted the NetBeans platform binaries (downloaded from the above link) into the release132/visualvm directory, you can build the entire application and it's plugins by running ant build from the release32/plugins directory.

I successfully completed this entire process and can verify that the instructions work for 1.3.2 . However, the instructions for building the trunk did not result in a successful build due to at least one missing dependency.

What the error that you were seeing was telling you was that the NetBeans platform's build harness could not be located. The harness is included in the downloadable binary and once you've extracted it into the release32/visualvm directory the values that are in the project.properties file will once again be valid. This is of course a good example of why you should keep everything needed to successfully reproduce a build in your repository!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM