Changes between Version 104 and Version 105 of DevelopersGuide/DevelopingPlugins


Ignore:
Timestamp:
2021-08-19T18:50:59+02:00 (4 years ago)
Author:
skyper
Comment:

fix some links; harmonize format syntax; SelectionChangedListener still needs an update

Legend:

Unmodified
Added
Removed
Modified
  • DevelopersGuide/DevelopingPlugins

    v104 v105  
    1010
    1111== Setting up the environment ==
    12 
    1312 * Check out the plugin environment into an empty directory called {{{josm}}}. Make sure path contains only ASCII characters, otherwise build may fail.
    1413{{{
     
    5554
    5655== Debugging (using Eclipse) ==
    57 
    5856If you need to debug a plugin, it can easily be done using Eclipse:
    5957
    60581. Import your plugin as an existing project in Eclipse
    61 2. Either
    62   a. Import the JOSM project to the same workspace and add it as a required project on the build path (your extension -> Properties -> Java Build Path -> Projects -> Add). Or
    63   b. Open your project properties to add required libraries (Properties -> Java Build Path -> Libraries -> Add External JARs). You must at least add `josm/core/dist/josm-custom.jar`, but you may also add your plugin dependencies if any (for instance `josm/dist/utilsplugin2.jar`).
    64 3. Make sure the plugin is added to the `plugins` list in the [wiki:/Help/Preferences/Advanced Advanced preferences] in JOSM and copy any version of your extension to the plugin directory (essentially, only the entry point is relevant here, so `plugin.class` has to be set correctly).
    65 4. Create a `Run Configuration` (Properties -> Run/Debug Settings -> New -> Java Application). Main class must be set to `org.openstreetmap.josm.gui.MainApplication`.
    66 5. You can now tweak your plugin and/or set breakpoints… etc.
     591. Either
     60 a. Import the JOSM project to the same workspace and add it as a required project on the build path (your extension -> Properties -> Java Build Path -> Projects -> Add). Or
     61 a. Open your project properties to add required libraries (Properties -> Java Build Path -> Libraries -> Add External JARs). You must at least add `josm/core/dist/josm-custom.jar`, but you may also add your plugin dependencies if any (for instance `josm/dist/utilsplugin2.jar`).
     621. Make sure the plugin is added to the `plugins` list in the [wiki:/Help/Preferences/Advanced Advanced preferences] in JOSM and copy any version of your extension to the plugin directory (essentially, only the entry point is relevant here, so `plugin.class` has to be set correctly).
     631. Create a `Run Configuration` (Properties -> Run/Debug Settings -> New -> Java Application). Main class must be set to `org.openstreetmap.josm.gui.MainApplication`.
     641. You can now tweak your plugin and/or set breakpoints… etc.
    6765
    6866== Automated testing ==
    6967To add new unit tests, look at the folder "test" of these existing plugins:
    70 - opendata
    71 - turnrestrictions
    72 - alignways
    73 - elevation
    74 - graphview
    75 - wikipedia
     68* opendata
     69* turnrestrictions
     70* alignways
     71* elevation
     72* graphview
     73* wikipedia
    7674
    7775Make sure to set the SVN properties (externals and ignore)!
     
    8482
    8583== JOSM plugins ==
    86 
    8784=== A POJO as entry point ===
    88 
    8985The entry point for a JOSM plugin, the '''plugin main class''' is a Plain Old Java Object (POJO) which provides a constructor with one parameter of type [source:/trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java PluginInformation].
    9086
     
    142138There's nevertheless a plugin "interface" JOSM expects a plugin to provide. It consists of a collection of method signatures your plugin may implement. JOSM invokes the corresponding methods at some points in the application life cycle, provided the plugin actually implements these methods.
    143139
    144   * {{{public void mapFrameInitialized(MapFrame old, MapFrame new)}}}
    145 
    146   JOSM manages at most one [source:/trunk/src/org/openstreetmap/josm/gui/MapFrame.java MapFrame]. At startup, when JOSM displays the Message of the Day (MOTD) panel, the MapFrame is null. It is only created when the first [source:/trunk/src/org/openstreetmap/josm/gui/layer/Layer.java Layer] is added and it is removed and reset to null if the last layer is removed. Plugins implementing a method {{{mapFrameInitialized}}} are notified about the change of the current map frame.
     140 * {{{public void mapFrameInitialized(MapFrame old, MapFrame new)}}} \\
     141 JOSM manages at most one [source:/trunk/src/org/openstreetmap/josm/gui/MapFrame.java MapFrame]. At startup, when JOSM displays the Message of the Day (MOTD) panel, the MapFrame is null. It is only created when the first [source:/trunk/src/org/openstreetmap/josm/gui/layer/Layer.java Layer] is added and it is removed and reset to null if the last layer is removed. Plugins implementing a method {{{mapFrameInitialized}}} are notified about the change of the current map frame.
    147142 
    148   * {{{public PreferenceSetting getPreferenceSetting()}}}
    149  
    150   The [source:/trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java JOSM preference dialog] asks a plugin to supply an editor for its preferences. The editor must implement [source:/trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceSetting.java PreferenceSetting]. Return null from {{{getPreferenceSetting}}} or don't implement it if your plugin has no need to manage preferences.
    151 
    152   You have basically two choices to implement your preferences editor. The first one is to provide a preferences editor with its own toolbar button in the preferences dialog. To do this, the editor must implement [source:/trunk/src/org/openstreetmap/josm/gui/preferences/TabPreferenceSetting.java TabPreferenceSetting]. The class [source:/trunk/src/org/openstreetmap/josm/gui/preferences/DefaultTabPreferenceSetting.java DefaultTabPreferenceSetting] may help you to achieve this. Alternatively, the editor may plug itself as an additional tab of an existing editor (for example, Display settings). To do this, the editor must implement [source:/trunk/src/org/openstreetmap/josm/gui/preferences/SubPreferenceSetting.java SubPreferenceSetting].
    153 
    154   * {{{public void addDownloadSelection(List<DownloadSelection> list)}}}
    155 
    156   The [source:/trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java JOSM download dialog] asks a plugin to supply its own download method when the download dialog is created. The plugin must supply an object implementing [source:/trunk/src/org/openstreetmap/josm/gui/download/DownloadSelection.java DownloadSelection]. The download dialog also invokes {{{addGui(DownloadDialog gui)}}} on the supplied [source:/trunk/src/org/openstreetmap/josm/gui/download/DownloadSelection.java DownloadSelection] which gives you the chance to create an UI component (i.e. a JPanel) JOSM adds to the tabbed pane in the download dialog.  Reply the unmodified {{{list}}} or don't implement the method if your plugin doesn't provide its own download method. Plugins shouldn't remove and or reorder elements in {{{list}}}.
    157 
    158  
     143 * {{{public PreferenceSetting getPreferenceSetting()}}} \\ 
     144 The [source:/trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java JOSM preference dialog] asks a plugin to supply an editor for its preferences. The editor must implement [source:/trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceSetting.java PreferenceSetting]. Return null from {{{getPreferenceSetting}}} or don't implement it if your plugin has no need to manage preferences.
     145
     146 You have basically two choices to implement your preferences editor. The first one is to provide a preferences editor with its own toolbar button in the preferences dialog. To do this, the editor must implement [source:/trunk/src/org/openstreetmap/josm/gui/preferences/TabPreferenceSetting.java TabPreferenceSetting]. The class [source:/trunk/src/org/openstreetmap/josm/gui/preferences/DefaultTabPreferenceSetting.java DefaultTabPreferenceSetting] may help you to achieve this. Alternatively, the editor may plug itself as an additional tab of an existing editor (for example, Display settings). To do this, the editor must implement [source:/trunk/src/org/openstreetmap/josm/gui/preferences/SubPreferenceSetting.java SubPreferenceSetting].
     147
     148 * {{{public void addDownloadSelection(List<DownloadSelection> list)}}} \\
     149 The [source:/trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java JOSM download dialog] asks a plugin to supply its own download method when the download dialog is created. The plugin must supply an object implementing [source:/trunk/src/org/openstreetmap/josm/gui/download/DownloadSelection.java DownloadSelection]. The download dialog also invokes {{{addGui(DownloadDialog gui)}}} on the supplied [source:/trunk/src/org/openstreetmap/josm/gui/download/DownloadSelection.java DownloadSelection] which gives you the chance to create an UI component (i.e. a JPanel) JOSM adds to the tabbed pane in the download dialog.  Reply the unmodified {{{list}}} or don't implement the method if your plugin doesn't provide its own download method. Plugins shouldn't remove and or reorder elements in {{{list}}}.
     150
    159151=== The JOSM API ===
    160152The initial JOSM author preferred public fields in Java classes over public methods, including public getters and setters. He justified this decision as follows:
     
    174166JOSM plugins can '''register''' for a couple of '''events''' emitted by JOSM.
    175167
    176   * '''layer change events'''
    177 
    178   Implement a [source:/trunk/src/org/openstreetmap/josm/gui/layer/LayerManager.java LayerChangeListener] and register it using [source:/trunk/src/org/openstreetmap/josm/gui/layer/LayerManager.java#L33 Main.getLayerManager().addLayerChangeListener(LayerChangeListener listener)]. JOSM will then notify you about added, removed, and renamed layers. You may only or also register an [source:/trunk/src/org/openstreetmap/josm/gui/layer/LayerManager.java org.openstreetmap.josm.gui.MapView.ActiveLayerChangeListener] in which case JOSM will notify the plugin about changes in the current edit layer, in particular whether there is or there isn't a current edit layer.
    179 
    180   * '''selection change listener'''
    181 
    182   If your plugin needs to respond to changes in the currently selected set of OSM objects it can implement a [source:/trunk/src/org/openstreetmap/josm/data/SelectionChangedListener.java org.openstreetmap.josm.data.SelectionChangedListener] and add it to the global list {{{org.openstreetmap.josm.data.osm.DataSet.selListeners}}}.
    183 
    184   * '''data change events'''
    185 
    186   If your plugin needs to respond to changes in the data managed by [source:/trunk/src/org/openstreetmap/josm/layer/OsmDataLayer.java org.openstreetmap.josm.layer.OsmDataLayer]s it can implement a  [source:/trunk/src/org/openstreetmap/josm/data/osm/event/DataSetListener.java org.openstreetmap.josm.data.osm.event.DataSetListener] and register it on the data set of an OsmDataLayer using {{{layer.ds.addDataSetListener(yourlistener)}}}. JOSM will notify the listener about added, modified, and deleted objects in the dataset.
    187 
    188   Make sure your plugin also unregisters as data set listener when the respective OsmDataLayer is deleted. Listen to layer change events to and respond to layer deleted events.
    189 
    190   * ''' preference change listener'''
    191   If your plugin needs to respond to general changes in the JOSM preferences it can implement a [source:/trunk/src/org/openstreetmap/josm/data/Preferences.java org.openstreetmap.josm.data.Preferences.PreferenceChangedListener]. Invoke {{{addPreferenceChangedListener(PreferenceChangedListener listener)}}} on {{{Main.pref}}}. You are encouraged to use a property object like [source:/trunk/src/org/openstreetmap/josm/data/preferences/IntegerProperty.java IntegerProperty] to access preferences. You can register a listener to that single preference there.
     168 * '''layer change events''' \\
     169 Implement a [source:/trunk/src/org/openstreetmap/josm/gui/layer/LayerManager.java LayerChangeListener] and register it using [source:/trunk/src/org/openstreetmap/josm/gui/layer/LayerManager.java#L33 Main.getLayerManager().addLayerChangeListener(LayerChangeListener listener)]. JOSM will then notify you about added, removed, and renamed layers. You may only or also register an [source:/trunk/src/org/openstreetmap/josm/gui/layer/LayerManager.java org.openstreetmap.josm.gui.MapView.ActiveLayerChangeListener] in which case JOSM will notify the plugin about changes in the current edit layer, in particular whether there is or there isn't a current edit layer.
     170
     171 * '''selection change listener''' \\
     172 If your plugin needs to respond to changes in the currently selected set of OSM objects it can implement a [source:/trunk/src/org/openstreetmap/josm/data/SelectionChangedListener.java org.openstreetmap.josm.data.SelectionChangedListener] and add it to the global list {{{org.openstreetmap.josm.data.osm.DataSet.selListeners}}}.
     173
     174 * '''data change events''' \\
     175 If your plugin needs to respond to changes in the data managed by [source:/trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java org.openstreetmap.josm.layer.OsmDataLayer]s it can implement a  [source:/trunk/src/org/openstreetmap/josm/data/osm/event/DataSetListener.java org.openstreetmap.josm.data.osm.event.DataSetListener] and register it on the data set of an OsmDataLayer using {{{layer.ds.addDataSetListener(yourlistener)}}}. JOSM will notify the listener about added, modified, and deleted objects in the dataset.
     176
     177 Make sure your plugin also unregisters as data set listener when the respective OsmDataLayer is deleted. Listen to layer change events to and respond to layer deleted events.
     178
     179 * ''' preference change listener''' \\
     180 If your plugin needs to respond to general changes in the JOSM preferences it can implement a [source:/trunk/src/org/openstreetmap/josm/data/Preferences.java org.openstreetmap.josm.data.Preferences.PreferenceChangedListener]. Invoke {{{addPreferenceChangedListener(PreferenceChangedListener listener)}}} on {{{Main.pref}}}. You are encouraged to use a property object like [source:/trunk/src/org/openstreetmap/josm/data/preferences/IntegerProperty.java IntegerProperty] to access preferences. You can register a listener to that single preference there.
    192181
    193182=== Accessing the local file system ===
    194 JOSM plugins are currently allowed to read from and write to the local file system. Please write plugin specific files to {{{${josm.home}/preferences/${pluginname}}}}. If your plugin main class subclasses from [source:/trunk/src/org/openstreetmap/josm/plugin/Plugin.java Plugin] you can use the method {{{String getPluginDir()}}} to get the name of the plugin specific data directory.
     183JOSM plugins are currently allowed to read from and write to the local file system. Please write plugin specific files to {{{${josm.home}/preferences/${pluginname}}}}. If your plugin main class subclasses from [source:/trunk/src/org/openstreetmap/josm/plugins/Plugin.java Plugin] you can use the method {{{String getPluginDir()}}} to get the name of the plugin specific data directory.
     184
    195185
    196186== Packaging a plugin ==
    197 
    198187=== A plugin is deployed as a single jar ===
    199188A JOSM plugin is deployed as a single **Java 8** jar file. The jar files name must be equal to the plugin name, i.e. {{{routing4all.jar}}}.
    200189
    201190The jar file must include
    202   * the required java classes, including any additional libraries the plugin requires
    203   * icons (.png or .svg, .svg is preferred), deployed data files, and other resources
    204   * a manifest file with JOSM specific entries (see below)
     191 * the required java classes, including any additional libraries the plugin requires
     192 * icons (.png or .svg, .svg is preferred), deployed data files, and other resources
     193 * a manifest file with JOSM specific entries (see below)
    205194
    206195=== The manifest file for a JOSM plugin ===
     
    218207||'''Plugin-Date'''||optional||The creation date of the plugin in ISO format.||
    219208||'''Plugin-Early'''||optional||Can be set to {{{true}}}, in which case the plugin is loaded as early as possible, more specific before the GUI classes are loaded. This is usefull if your plugin alters the GUI or the JOSM-startup process in any way.||
    220 ||'''Plugin-Link'''||optional||Informational URL to a webpage or other information source about that plugin. Is also used in the [wiki:Plugins plugins] information page.||
    221 ||'''Plugin-Icon'''||optional||The icon to display in the plugin list. The image must be a .png or .svg (.svg is preferred) file and be included in the plugin jar file. Give the full relative path, e.g. {{{images/preferences/plugin.svg}}}[[BR]]The images are collected by a server script in regular intervals. The JOSM clients download the entire [/plugin-icons.zip archive] along with the plugin list.||
     209||'''Plugin-Link'''||optional||Informational URL to a webpage or other information source about that plugin. Is also used in the [wiki:/Plugins plugins] information page.||
     210||'''Plugin-Icon'''||optional||The icon to display in the plugin list. The image must be a .png or .svg (.svg is preferred) file and be included in the plugin jar file. Give the full relative path, e.g. {{{images/preferences/plugin.svg}}} \\ The images are collected by a server script in regular intervals. The JOSM clients download the entire [/plugin-icons.zip archive] along with the plugin list.||
    222211||'''Plugin-Requires'''||optional||A list of other plugins which are required before plugin works. The list is separated by semi colons.||
    223212||'''Plugin-Stage'''||optional||An number of the order relative to other plugins, when the plugin is loaded. Smaller numbers gets loaded first, so if you have conflicts with other plugins, you can increase or decrease this number to get some control on the loading order. Defaults to 50.||
    224 ||'''Plugin-Canloadatruntime'''||optional||Should be set to {{{true}}} if the plugin can be installed without restart. See [wiki:DevelopersGuide/PluginInstallationWithoutRestart PluginInstallationWithoutRestart] for details.||
     213||'''Plugin-Canloadatruntime'''||optional||Should be set to {{{true}}} if the plugin can be installed without restart. See [wiki:/DevelopersGuide/PluginInstallationWithoutRestart PluginInstallationWithoutRestart] for details.||
    225214||'''Class-Path'''||optional||An space-separated list of additional classpaths your plugin wants to use when looking for ressources and classes. The plugin itself is added automatically. Don't forget to provide the additional jar's as well, if you add dependencies here. Note that all loaded plugins are in the class-path automatically, so don't specify plugin-dependencies here.||
    226 ||'''<xxx>_Plugin-Url'''||optional||To support older JOSM versions, special entries may be added to supply older, compatible, versions of the plugin. For plugins maintained in the main plugin subversion repository, this is usually not necessary, since the JOSM server keeps track of compatible versions, when the '''Plugin-Mainversion''' is updated (see section '''Publishing the new plugin''' below). It ''is'' however useful, when the plugin is hosted on a different server, but still available as convenient download from within JOSM. [[br]]This information will then be used by the internal plugin handler to download a matching plugin version both for the first download and on update. There can be multiple '''<xxx>_Plugin-Url''' entries, the format is ''<josm_version>_Plugin-Url: <plugin_version>;<url>''. Here, ''<josm_version>'' denotes the lowest JOSM version, the plugin ''<plugin_version>'' will work with and it can be downloaded using ''<url>''. ||
     215||'''<xxx>_Plugin-Url'''||optional||To support older JOSM versions, special entries may be added to supply older, compatible, versions of the plugin. For plugins maintained in the main plugin subversion repository, this is usually not necessary, since the JOSM server keeps track of compatible versions, when the '''Plugin-Mainversion''' is updated (see section '''Publishing the new plugin''' below). It ''is'' however useful, when the plugin is hosted on a different server, but still available as convenient download from within JOSM. \\ This information will then be used by the internal plugin handler to download a matching plugin version both for the first download and on update. There can be multiple '''<xxx>_Plugin-Url''' entries, the format is ''<josm_version>_Plugin-Url: <plugin_version>;<url>''. Here, ''<josm_version>'' denotes the lowest JOSM version, the plugin ''<plugin_version>'' will work with and it can be downloaded using ''<url>''. ||
    227216||'''<lang>_Plugin-Description'''||optional||The translated description text for the plugin. E.g. ''de_Plugin-Description'' contains the German translation.||
    228217
    229218For SVN managed plugins, the links to old versions and the translated descriptions are automatically added to the [/plugin plugin information], so JOSM can use that when it displays the list of plugins in the preference dialog.
    230219
     220
    231221== Translating a plugin ==
    232 
    233222JOSM uses a gettext-compatible translation system, but uses its own file format for storing the data. To use the translation feature you need to do following:
    234223
     
    245234
    246235== Publishing a plugin ==
    247 The plugin list a user sees ([/plugin here]) is automatically generated at regular intervals (currently about 10 minutes) from plugin JAR files (**built with Java 8**) that are located in [source:osm/applications/editors/josm/dist/ josm/dist] on the OSM.org SVN repository (referred to as "internal" plugins) and from links that are embedded in the [[wiki:Plugins]] page (referred to as "external" plugins). Each method has advantages and disadvantages.
     236The plugin list a user sees ([/plugin here]) is automatically generated at regular intervals (currently about 10 minutes) from plugin JAR files (**built with Java 8**) that are located in [source:osm/applications/editors/josm/dist/ josm/dist] on the OSM.org SVN repository (referred to as "internal" plugins) and from links that are embedded in the [wiki:/Plugins Plugins] page (referred to as "external" plugins). Each method has advantages and disadvantages.
    248237
    249238Advantages of hosting code externally:
     
    252241
    253242Disadvantages of hosting code externally:
    254 * Strings are less likely to be [[Translations|translated]] due to reduced visibility
     243* Strings are less likely to be [wiki:/Translations translated] due to reduced visibility
    255244* Changes in the core aren't likely to be propagated to the plugin unless done so by the plugin author(s)
    256 * Shortcuts won't be listed in [[DevelopersGuide/ShortcutsList|the overview]] and thus will very likely be used by others
    257 * Help pages won't be listed in [[DevelopersGuide/HelpSystem/HelpTopicsList|the help topics list]]
     245* Shortcuts won't be listed in [wiki:/DevelopersGuide/ShortcutsList the overview] and thus will very likely be used by others
     246* Help pages won't be listed in [wiki:/DevelopersGuide/HelpSystem/HelpTopicsList the help topics list]
    258247
    259248Disadvantages of hosting JAR externally:
     
    261250* There is no automatic history handling for older JOSM versions
    262251
    263 To support git for development as well as SVN, JOSM has a [[https://github.com/JOSM|GitHub account]]. Plugins developed in that account are treated similar to the ones directly in SVN.
     252To support git for development as well as SVN, JOSM has a [https://github.com/JOSM GitHub account]. Plugins developed in that account are treated similar to the ones directly in SVN.
    264253
    265254=== Managing a plugin in plugin SVN ===
     
    274263
    275264==== Updating a plugin in SVN ====
    276 
    277265You have found a bug in a plugin and you are able to fix it. Then your next steps are:
    278266
    279267===== Fixing the bug =====
    280   1. fix the bug in the plugin, compile it, run it locally in JOSM, and test it
     2681. fix the bug in the plugin, compile it, run it locally in JOSM, and test it
    281269
    282270===== Publishing the new plugin =====
    283   1. Did you change something which will not work with every JOSM version? Then you should update '''Plugin-Mainversion''' in {{{build.xml}}}
    284      * look for the line {{{<attribute name="Plugin-Mainversion" value="..."/>}}}
    285      * replace the value by the lowest JOSM version required for the plugin after you've applied your fix [[BR]]Do not increase '''Plugin-Mainversion''' if not necessary, though. If you do, JOSM ''requires'' users to update to the new version, otherwise users can ''choose'' whether they want to upgrade. {{{Plugin-Mainversion}}} should always consist of the ''lowest possible revision''.
    286   1. commit the new modified source
    287   1. '''counter intuitive, but important - update again from the SVN''' - after having commited you '''must''' update the source again from the SVN. This ensures that {{{Plugin-Version}}} in the plugin {{{MANIFEST}}} will reflect the plugins SVN revision number
    288   1. build the plugin using {{{ant clean}}} and {{{ant dist}}}. This creates the plugin jar file in the {{{/dist}}} directory.
    289   1. commit the {{{.jar}}} file in the {{{dist}}} directory
     2711. Did you change something which will not work with every JOSM version? Then you should update '''Plugin-Mainversion''' in {{{build.xml}}}
     272 * look for the line {{{<attribute name="Plugin-Mainversion" value="..."/>}}}
     273 * replace the value by the lowest JOSM version required for the plugin after you've applied your fix \\ Do not increase '''Plugin-Mainversion''' if not necessary, though. If you do, JOSM ''requires'' users to update to the new version, otherwise users can ''choose'' whether they want to upgrade. {{{Plugin-Mainversion}}} should always consist of the ''lowest possible revision''.
     2741. commit the new modified source
     2751. '''counter intuitive, but important - update again from the SVN''' - after having commited you '''must''' update the source again from the SVN. This ensures that {{{Plugin-Version}}} in the plugin {{{MANIFEST}}} will reflect the plugins SVN revision number
     2761. build the plugin using {{{ant clean}}} and {{{ant dist}}}. This creates the plugin jar file in the {{{/dist}}} directory.
     2771. commit the {{{.jar}}} file in the {{{dist}}} directory
    290278
    291279===== Closing trac ticket =====
    292   1. Did you fix the bug based on a trac ticket? Please close it and leave a note. You can refer to the new plugin version using the macro {{{r12345/osm}}} (use {{{[o12345]}}} if the change is only available on https://trac.openstreetmap.org), where 12345 is a plugin revision number.
     2801. Did you fix the bug based on a trac ticket? Please close it and leave a note. You can refer to the new plugin version using the macro {{{r12345/osm}}} (use {{{[o12345]}}} if the change is only available on https://trac.openstreetmap.org), where 12345 is a plugin revision number.
    293281
    294282Ready. The new plugin version is now available. If necessary, JOSM asks users to upgrade to the new version, when JOSM is started up.
     
    296284The steps described above can be automated, see [source:osm/applications/editors/josm/plugins/tageditor/build.xml build.xml of the tageditor plugin]. It includes an ant target {{{publish}}}.
    297285
     286
    298287== Legal stuff (Imis opinion) ==
    299 
    300288Just because I have been asked: JOSM is licensed under GPL and if any code is a "derived work" of JOSM, then it has to be under GPL too. It is my belief that any JOSM-Plugin is a derived work of JOSM, so GPL is the only possible license for a JOSM-Plugin. If you want to include non-GPL code into a plugin, it has to be separated from the classes that use JOSM. "Use" as in "import org.openstreetmap.josm...". See the 'Class-Path' - MANIFEST.MF attribute for a way to include other jar files.
    301289