= IntelliJ nice way to duplicate an existing project =
Have your base project open
From the project use {nav Right Click > Refactor > Copy... }
{F11818148, size=full}
Give it a new name and select the **Parent Directory**
{F11818151, size=full}
IntelliJ creates it but does not open it automatically
Go to nav{File > Open...}
Select the folder with your new project, here `new-project`
{F11818154, size=full}
== Changes to reflect the new project properties ==
=== In the POM ===
To reflect the new project. Important fields are
# `artifactId`,
# `name`
# `description`
# `main-class` (in the `properties` tag)
=== In the {nav File > Project Structure...}
You can change the following things
`Project Name`
{F11818206, size=full}
`Module Name` under **Modules**
{F11818216, size=full}
=== The actual Java Class ===
Navigate to one of the Java Classes in your new project and hit
{nav Right-click > Refactor > Rename...}
And rename it to reflect your new project.
== Nice things to have ==
If you want to have your resulting JAR and dependencies copied to a Fiji subdirectory when you hit **install**
You need to add this in your POM under the `<Properties>` tag
`<scijava.app.subdirectory>plugins/MyFolder</scijava.app.subdirectory>`
For this to work, and according to best practices, you need to create a `settings.xml` file in your `$HOME/.m2/` folder.
The file does not exist initially, so you should create it and then add the following.
```
<settings>
<profiles>
<profile>
<id>imagej</id>
<activation>
<file>
<exists>C:/Fiji-Dev/</exists>
</file>
</activation>
<properties>
<scijava.app.directory>C:/Fiji-Dev/</scijava.app.directory>
<delete.other.versions>true</delete.other.versions>
</properties>
</profile>
</profiles>
</settings>
```
(This will now be applied to all your projects involving ImageJ)
Change the location of the Fiji installation you want to copy your jars to
And you need to add this in your POM under the `<Properties>` tag
`<scijava.app.subdirectory>plugins/MyFolder</scijava.app.subdirectory>`