// 
//     Licensed to the Apache Software Foundation (ASF) under one
//     or more contributor license agreements.  See the NOTICE file
//     distributed with this work for additional information
//     regarding copyright ownership.  The ASF licenses this file
//     to you under the Apache License, Version 2.0 (the
//     "License"); you may not use this file except in compliance
//     with the License.  You may obtain a copy of the License at
// 
//       http://www.apache.org/licenses/LICENSE-2.0
// 
//     Unless required by applicable law or agreed to in writing,
//     software distributed under the License is distributed on an
//     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
//     KIND, either express or implied.  See the License for the
//     specific language governing permissions and limitations
//     under the License.
//

= DevFaqMigratingToNewerPlatform
:jbake-type: wiki
:jbake-tags: wiki, devfaq, needsreview
:jbake-status: published
:keywords: Apache NetBeans wiki DevFaqMigratingToNewerPlatform
:description: Apache NetBeans wiki DevFaqMigratingToNewerPlatform
:toc: left
:toc-title:
:syntax: true

== Migrating to a newer version of the Platform

When migrating a module suite application to use a newer version of the platform you may want to be aware of the following issues:

* *The newer platform may contain new modules in the platform and/or ide cluster that are not excluded in your platform.properties*
* The clusters that your application depends on may have added new modules.  If you enabled a cluster and disabled all the modules you did not need before, you may be surprised when you go to build your application with the newer platform and get warning about module dependency errors.  This is because the cluster has added new modules that are not listed as being excluded for your project. If you get errors regarding module dependencies when you migrate, you may want to check your project's settings to see if there are new modules that were introduced that you do not need and disable them.

* *The newer platform may include modules with newer versions*
* For example, in 6.9, the Lookup classes have been moved into a separate module, named Lookup API. Therefore, all modules making use of Lookup need a new dependency on this new module. Also, dependencies on the Utilities API module, which previously contained the Lookup classes, need to be updated to the latest version. For Ant-based NetBeans Platform applications, run this target for each module making use of Lookup-related classes:

	<pre> ant fix-dependencies 	</pre> 

* In the IDE, you can do the following to run the above Ant target: 
* Important Files > Build Scripts (right click) > Run target > fix-dependencies. 
* Also, instead of the above, you can simply add the Lookup API module to each module that makes use of the Lookup classes. For each module, right-click the module in NetBeans IDE, choose Properties, go to the Libraries panel, click Add Dependency, and then add the Lookup module. For the Utilities API module, you can remove it from the list of dependencies and then readd it to set the correct version of the dependency. 
* The difference between the above two options is as follows: The second option is much faster - perhaps 15 seconds for each module. The first option (ant fix-dependencies) is much slower - perhaps two minutes or more per module - but it is much more complete and generic in that it removes old unused dependencies as well as adding new dependencies.
* To achieve the above for Maven-based NetBeans Platform applications
* you need to add the Lookup dependency to the POM of all modules that use Lookup:
[source,xml]
----

<dependency>
    <groupId>org.netbeans.api</groupId>
    <artifactId>org-openide-util-lookup</artifactId>
    <version>${netbeans.version}</version>
</dependency>	
----

 

* For Maven-based applications
* you also need to update the "platform" definition (from "platform11" to "platform") in the application module:
[source,xml]
----

<dependency>
    <groupId>org.netbeans.cluster</groupId>
    <artifactId>platform</artifactId>
    <version>${netbeans.version}</version>
    <type>pom</type>
</dependency>
----

* *API-changes/New or Deprecated API/Incompatibilities*
* link:http://bits.netbeans.org/dev/javadoc/apichanges.html[http://bits.netbeans.org/dev/javadoc/apichanges.html]

== Further Resources

* link:http://bruehlicke.blogspot.com/2016/10/porting-my-nb-65-rcp-app-to-nb-82.html[http://bruehlicke.blogspot.com/2016/10/porting-my-nb-65-rcp-app-to-nb-82.html]

=== Apache Migration Information

The content in this page was kindly donated by Oracle Corp. to the
Apache Software Foundation.

This page was exported from link:http://wiki.netbeans.org/DevFaqMigratingToNewerPlatform[http://wiki.netbeans.org/DevFaqMigratingToNewerPlatform] , 
that was last modified by NetBeans user Markiewb 
on 2016-11-24T13:02:17Z.


*NOTE:* This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.
