How to deploy an add-in project from Eclipse


Summary
The following topic describes the process of deploying an add-in project from Eclipse and consuming the add-in in your desktop applications.

In this topic


About deploying your add-in in Eclipse

The following guides you through the process of deploying an example add-in project using the Eclipse integrated development environment (IDE). Before beginning this workflow, make sure that you have created an ArcMap add-in project using Eclipse. For more information, see How to create an add-in project in Eclipse.
This scenario also assumes that you have created and defined at least one type of add-in. Since there is no difference between deploying an add-in for any of the ArcGIS for Desktop applications, this workflow shows you how to deploy a project with a single button. After that, this topic shows you how to consume the add-in in ArcMap.
To start, ensure that the Eclipse project is opened and that the add-in view of the add-in editor is displayed. Do the following steps to deploy your project:
  1. Click Export under the Add-In Overview section. See the following screen shot:



    Exporting the add-in in a format suitable for deployment takes the project defined in this instance and begins the process of exporting. After clicking Export, the Java Archive (JAR) file Export dialog box appears. By default, the Select the resources to export area selects all of the resources necessary to create the .esriaddin file. As the following screen shot shows, this includes the ArcMapDeployEclipse project, which contains the source code for the button and the image folder. The area to the right includes the config.xml file, but excludes the Eclipse .classpath and .project files since these files are specific to Eclipse projects, and not the .esriaddin file that is being deployed.



    By default, the Export generated class files and resources check box is selected, and should be left selected unless there is a class file or resource you do not want to export as part of the add-in deployment. The remaining options are standard JAR deployment questions. Decisions on those should be made accordingly to your deployment needs. See the following screen shot:



    The export destination location is set by default to one of the following locations:
    • %USERPROFILE%\My Documents\ArcGIS\AddIns\Desktop10.0
    • %USERPROFILE%\Documents\ArcGIS\AddIns\Desktop10.0
    The %USERPROFILE% environment variable represents the user profile location on a Windows operating system (this is defined for all Windows operating systems). Depending on which operating system you have, the .esriaddin file goes into the My Documents or Documents folder as shown on the following screen shot. For a list of supported Windows operating systems, see ArcGIS Engine System Requirements. This location is significant, because by default, it is monitored by all ArcGIS for Desktop applications. 

    When a .esriaddin file is deployed to this location and an ArcGIS for Desktop application is started, the application picks up the add-in if it applies. By default, Eclipse  automatically deploys to this well known location and determines which supported operating system you are on to deploy to the correct location. However, it is possible that you might not want to deploy to this location. It can be modified by clicking Browse on the JAR Export dialog box. See the following screen shot:



    The file name uses your Eclipse project name as defined when creating your project.  The .esriaddin file extension is appended to the project name, not the .jar file extension that you might expect. The .esriaddin extension is a special file extension that allows ArcGIS for Desktop applications to recognize add-ins. The config.xml file that is packaged within the .esriaddin file, is used to determine which software product the add-in applies to.
If you choose a new location to deploy your add-in other than the default and modify the file name, verify that the name of your add-in deployment file ends in the .esriaddin file extension. Also, Eclipse's default JAR file extension is .jar; however, add-in projects have a unique file .esriaddin extension.
The remaining options on the JAR Export wizard are standard options and are left to your organization's needs when deploying the add-in.
  1. Click Finish on the wizard.
You can click the Next button to set additional items for the export process; however, none of these additional options are necessary for creating an .esriaddin file. You can change these options as appropriate to meet your organization's needs.
The project is now deployed. If you deployed to the default location, proceed to the next section. If you deployed to a location other than the default defined for you on the JAR Export dialog box, see How to use double-click deployment or How to deploy using the Add-In Manager for details on how you deploy the add-in before testing or using it.

Using the customization

Once you have successfully deployed your project to the well known location, you are  ready to use the customization in the ArcGIS for Desktop application for which it was designed. Since the previous add-in was designed for ArcMap, the following shows you how to work with the add-in through ArcMap.
  1. Start ArcMap.
  2. Click the Customize menu and click Add-In Manager. See the following screen shot:



    One way to verify that the deployed add-in works is to access the Add-In Manager, which lists all of the registered add-ins under the My Add-Ins section. On the right area, more metadata about the add-in is made available. You can see with this example, that an ArcMap Button has been deployed as part of the ArcMap add-in project. Each desktop application identifies only add-ins that are designed for it. In this case, you should never see an ArcCatalog or any other add-in type on the Add-In Manager list for ArcMap.
  3. Click Customize on the Add-In Manager. The Customize dialog box appears.
If you click the Customize menu in ArcMap and choose Customize Mode, the same Customize dialog box appears as in Step 3.
  1. Click the Commands tab on the Customize dialog box. See the following screen shot:

  1. Click ArcMap Add-Ins under the Categories area.
The category you supplied in your add-in determines the name that shows here. For this example, ArcMap Add-Ins is the category provided for the defined button and is shown under the Categories section on the Commands tab.
  1. Select ArcMap Button under the Commands area and drag it to the graphical user interface (GUI) in ArcMap; more specifically, onto an existing toolbar.
  2. Click Customize. A message dialog box appears with the "Hello, World!" message. Similarly, tools can also be found in the same location as buttons. Toolbars can be found under the Toolbars tab on the Customize dialog box. All other add-ins are exposed using different techniques and are discussed in each topic that describes each add-in.






Development licensingDeployment licensing
ArcGIS for Desktop BasicArcGIS for Desktop Basic
ArcGIS for Desktop StandardArcGIS for Desktop Standard
ArcGIS for Desktop AdvancedArcGIS for Desktop Advanced