NetBeans => IntelliJ

I am in the process of switching from NetBeans IDE to IntelliJ. There is  help from moving from Eclipse, but not NetBeans. Here are a couple of  questions?

1. I have a NetBeans tools project that I include in about 16 other  projects. I want to be able to include this Tools project without having  a separate copy in each of 16 projects. I don't want to just include  the jar file from the Tools project because I want to be able to edit  the classes in the Tools project while I work on the 16 main projects.  It is not very clear in the documentation how to do this. Any suggestions about where to look?

2. NetBeans creates an ant build.xml structure that builds my jar files  with a proper manifest.mf file that builds the Class-Path and Main-Class  attributes so that $ java -jar project.jar just works without any  setup. Is there an IntelliJ plugin for this?

3. IntelliJ builds a 'war' directory for my web apps, but not a .war  file? Do I also need to build that myself and do I have to leave the IDE  to create the war file or can I run a custom ANT target from within IntelliJ

Thanks

1 comment
Comment actions Permalink

pluck308 wrote:

1. I have a NetBeans tools project that I include in about 16 other  projects. I want to be able to include this Tools project without having  a separate copy in each of 16 projects. I don't want to just include  the jar file from the Tools project because I want to be able to edit  the classes in the Tools project while I work on the 16 main projects.  It is not very clear in the documentation how to do this. Any suggestions about where to look?


Create a module definition (using the "from existing code" option) for your Tools project. You can either 1) initially do this in one of the projects (File > Add Module or File > Project Structure > Modules > click add icon) or 2) create an IntelliJ IDEA project for your Tools Project. Once you have that module defined, add that module to each the other projects using the "Import existing module" option in the add module dialog (File > Add Module or File > Project Structure > Modules > click add icon). To add the existing module, just navigate to and select the .iml (idea module) file.

pluck308 wrote:
2. NetBeans creates an ant build.xml structure that builds my jar files  with a proper manifest.mf file that builds the Class-Path and Main-Class  attributes so that $ java -jar project.jar just works without any  setup. Is there an IntelliJ plugin for this?

There's the built-in Generate Ant Build action available via Build > Generate Ant Build. I'm not real familiar with it since our projects are Maven based. It has an option to "inline classpaths". I'm not sure if that will do what you want. You can play with it and see.

pluck308 wrote:

3. IntelliJ builds a 'war' directory for my web apps, but not a .war  file? Do I also need to build that myself and do I have to leave the IDE  to create the war file or can I run a custom ANT target from within IntelliJ

I know for a maven 'war' module IDEA will auto generate a WAR file artifact definition. I'm not sure for a general 'web' facet. If it is not auto generating one, you can define one. Go into File > Project Structure and select 'Artifacts' on the left under "Project Settings". In there you can define a WAR file artifact. If you have added a 'Web' facet to the module, you should only need to select the 'web' (not the 'web exploded') definition from the Choose artifact dialog.  See "Configuring Artifacts" in the help guide for more information.

0

Please sign in to leave a comment.