Download presentation
Presentation is loading. Please wait.
1
Brian Leonard ブライアン レオナルド bleonard@sun.com
During this session we will explain how to get any of your existing projects opened in NetBeans. This is important if you are interested in giving NetBeans a try or you want to switch to NetBeans. So this session is particularly interesting for those who do not use NetBeans today, however it should be also useful for existing NetBeans users who will get a better understanding of NetBeans project infrastructure. Brian Leonard ブライアン レオナルド
2
Agenda Introduction About NetBeans Projects Automated Project Import
Manual Project Import Using Multiple IDEs Conclusion The agenda is following: at first we will discuss how does NetBeans deal with project infrastructure. We'll discuss different project types including so called free-form projects. Then we'll look at possibilities to import existing projects into NetBeans. Finally we'll discuss using NetBeans in a multi-IDE environment.
3
Goals Become friends with the NetBeans project system
Learn how projects can be imported into NetBeans Learn how NetBeans can be used alongside other IDEs As mentioned earlier, we'll show how to get an arbitraty project imported into NetBeans and how to work in a multi-IDE environment.
4
Agenda Introduction About NetBeans Projects Automated Project Import
Manual Project Import Using Multiple IDEs Conclusion Let's start with some background information about NetBeans projects which you'll need to understand how to migrate projects to NetBeans.
5
NetBeans projects Ant-based projects Project file: build.xml
Ant tightly integrated Can be extended NetBeans projects are based on Ant. NetBeans has currently the best integration with Ant, simply because your project file is the ant script called build.xml. All other IDEs use proprietary project formats, even though they support Ant, but that's never the default option. There are many advantages of using Ant for projects. One of them is that any build script can be easily extended, so you can modify what the IDE does on build, deployment, etc. We'll see that in a demo in a while. The other advantage is that you can take the build script outside of the IDE and run it without the IDE. Also, opening a NetBeans project in another IDE is much simpler thanks to Ant - all major IDEs support Ant. Finally we also provide many tools for Ant - e.g. you can run specific tasks from the IDE and map them to key shortcuts easily.
6
Two Project Types Regular projects Free-form projects
If you can, use regular projects Much easier, setup free Default file structure The IDE takes care of build.xml NetBeans provides to types of projects: regular and free-form. Both are based on Ant. Regular projects used by default and this is what you use when you create e.g. a Java application or a web application. Free-form projects are those projects which are marked as “with existing Ant script”. So Java application with existing Ant script is using a free-form project. Regular projects are much easier to use, so they are recommended to be used. You don't need to set anything up like in case of free-forms and you use the default file structure. The IDE takes care of the Ant script itself. However sometimes you need more flexibility and this is when you use free-form projects - e.g. when you have a special build environment or the default file structure doesn't work for you.
7
Demo NetBeans Project Basics
In this first demo we'll look at the Regular NetBeans project type, where we will demonstrate extending the build.xml script to perform a custom task. So you'll see how easily you can customize the build process in NetBeans.
8
Agenda Introduction About NetBeans Projects Automated Project Import
Manual Project Import Using Multiple IDEs Conclusion We've seen how NetBeans handles project structure. Now we'll look at ways of migrating projects into NetBeans. We'll start with automated project import.
9
Automated Import Good news for Java SE projects created with JBuilder or Eclipse: We have project importers Available on the update center They create the build.xml file Works for Java SE Projects Automated import is available for projects created in recent versions of JBuilder and Eclipse. You can get the project importer from the update center and then it appears in your File menu. The importer is basically a wizard which creates a new NetBeans project based on the original project. The importer is great for Java SE projects, however it doesn't handle Java EE or Mobile projects. So if you have a Java SE project in JBuilder or Eclipse, moving to NetBeans is extremely easy (as our demo will show) Currently the importer is available for JBuilder and Eclipse. We are thinking about creating an importer for IntelliJ IDEA since people ask for it. We are also considering to add functionality to import Java EE applications in the future.
10
Demo Eclipse Project Importer
In this demo we'll show the Eclipse project importer on a pretty popular Java SE project – JUnit. I'm sure Erich Gamma will be happy to learn how easy it is to start using NetBeans for his JUnit development :-). The workflow for JBuilder importer is very similar so we will not demo it.
11
Agenda Introduction About NetBeans Projects Automated Project Import
Manual project import Using Multiple IDEs Conclusion We've mentioned that automated project importer works only for Java SE projects. If you have another project type (e.g., web, mobile) you need to import your project manually.
12
Manual import Using regular projects
Create a New Project with Existing Sources Let NetBeans generate build.xml Using free-form projects Create a New Project with Existing Ant Script Reuse existing build.xml There are two ways how you can get your project into NetBeans. You either use the regular or free-form project type. In the case of regular project you basically create a new NetBeans project and point NetBeans to your existing sources. NetBeans will generate and maintain the build.xml for you. Alternatively, if you already have a build.xml, you can create a NetBeans project based on your existing Ant script. This is known as a free-form project and it is up to you to maintain your build.xml going forward. You can easily map NetBeans commands, such as Compile and Run to your equivalent Ant targets. Unless you are proficient with Ant, we recommend letting NetBeans maintain your build.xml. NetBeans is much more friendly when working with its own Ant script (debugging, profiling, etc.).
13
Agenda Introduction About NetBeans Projects Automated Project Import
Manual Project Import Using Multiple IDEs Conclusion So far we've only discussed importing projects, which means moving to NetBeans. Often developers work in a bigger team where people might be using different IDEs. So we'll discuss usage of NetBeans in a multi-IDE environment.
14
Using Multiple IDEs Regardless of how you get your project into NetBeans Whether using an automatic project importer (Eclipse or JBuilder) or manually importing your project into NetBeans, we simply create a benign nbproject directory to hold our metadata. The project structure is not affected in any other way. If you decide NetBeans is not for you, simply delete the nbproject directory and you're back to where you started. It's harmless and easy to still use those other IDEs
15
Sharing a Project Between
Demo Sharing a Project Between NetBeans and Eclipse In this demo will use the countries sample project that ships with the Spring Framework to show how the project can be easily shared between NetBeans and Eclipse.
16
Did you know...? There are Hibernate and Spring plug-ins for NetBeans
There is a vi plug-in for NetBeans NetBeans has keybindings for Eclipse and emacs The NetBeans 6 Editor is on par with Eclipse Maven is well integrated When using NetBeans in a multi-IDE environment it is important that NetBeans supports technologies used in the team. While NetBeans supports lots of different technologies out-of-the-box, some of them are supported by plug-ins. For example there is a Spring plug-in available on sourceforge.net. There are also two different Hibernate plug-ins. In past releases the editor of NetBeans was behind competition in terms of productivity features. With NetBeans 6 we are on par with Eclipse. There is also a vi plug-in and emacs keybindings are available in the Options dialog. If anyone in your team uses these editors, he can be productive in NetBeans. Finally Maven is also well integrated using a plug-in which is available on the update center.
17
Conclusion There are tools that help with project setup
Free-form projects and Maven are interesting for some scenarios You can use NetBeans in a multi-IDE environment There is no longer a reason for Eclipse users not to try NetBeans :-) For Java SE projects, NetBeans has project importers for Eclipse and JBuilder that will recognize the project dependencies and set up the NetBeans metadata. For other project types, such as web projects, it's easy enough to create the NetBeans project manually. In BOTH cases you can continue to work with the project in your other IDE. NetBeans simply adds it's benign nbproject directory for maintaining its project metadata. So there is no longer a reason for Eclipse users not to try NetBeans, and you know now how to move your project to NetBeans!
18
Thank you!
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.