# Is libtiled-java available on any maven server?

**URL:** <https://discourse.mapeditor.org/t/is-libtiled-java-available-on-any-maven-server/2491>\
**Category:** Questions\
**Created:** [June 22, 2017, 4:37pm UTC](https://discourse.mapeditor.org/t/is-libtiled-java-available-on-any-maven-server/2491 "2017-06-22T16:37:51Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Casper\_Faergemand](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@Casper\_Faergemand](https://discourse.mapeditor.org/u/Casper_Faergemand)\
**Post date:** [June 22, 2017, 4:37pm UTC](https://discourse.mapeditor.org/t/is-libtiled-java-available-on-any-maven-server/2491/1 "2017-06-22T16:37:51Z")

</div>

It doesn’t appear on Maven Central, is it available elsewhere? Can it be made available?

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [June 22, 2017, 7:35pm UTC](https://discourse.mapeditor.org/t/is-libtiled-java-available-on-any-maven-server/2491/2 "2017-06-22T19:35:53Z")

</div>

I guess it could, with the only problem that I have no idea what I’d need to do for this. The issue kind of got stuck here, and so far I haven’t gotten around at digging into those docs:

[https://github.com/bjorn/tiled/issues/397#issuecomment-274924418](https://github.com/bjorn/tiled/issues/397#issuecomment-274924418)

Any guidance would be greatly appreciated.

Note however, that apart from making libtiled-java properly accessible, a major issue is still that the library is somewhat outdated and doesn’t currently have a maintainer.

---

<div class="post-metadata">

**Author:** ![mikethomas](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/mikethomas/32/1296_2.png) [@mikethomas](https://discourse.mapeditor.org/u/mikethomas)\
**Post date:** [June 22, 2017, 8:39pm UTC](https://discourse.mapeditor.org/t/is-libtiled-java-available-on-any-maven-server/2491/3 "2017-06-22T20:39:43Z")

</div>

I uploaded an older version to sonatype snapstots repository a while back, which can be acessed by adding the following to your pom:

```
<repositories>
    <repository>
        <id>sonatype-oss</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.mapeditor</groupId>
        <artifactId>libtiled</artifactId>
        <version>0.17-SNAPSHOT</version>
        <type>jar</type>
    </dependency>
    ...
</dependencies>

```

I am currently updating the java libraries to use the latest tmx map updates (see [https://github.com/mikepthomas/tiled/commit/e95050054df80ba871323feccdf73f973a79f875](https://github.com/mikepthomas/tiled/commit/e95050054df80ba871323feccdf73f973a79f875)) which I am using for a personal project I am developing which is taking up most of my free time at the moment.

The binaries need to be signed by a pgp key so that they can be upladed to maven central… @bjorn, if you are ok with me using my own key rather than yours? then I can see about publishing the version in the master branch to central for you.

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [June 22, 2017, 9:06pm UTC](https://discourse.mapeditor.org/t/is-libtiled-java-available-on-any-maven-server/2491/4 "2017-06-22T21:06:38Z")

</div>

> [@mikethomas](#):
>
> I am currently updating the java libraries to use the latest tmx map updates (see [Refactor package names to org.mapeditor, create model from xsd and up… · mikepthomas/tiled@e950500 · GitHub](https://github.com/mikepthomas/tiled/commit/e95050054df80ba871323feccdf73f973a79f875)) which I am using for a personal project I am developing which is taking up most of my free time at the moment.

What a huge change! Looking forward to reviewing it. 😉

> [@mikethomas](#):
>
> The binaries need to be signed by a pgp key so that they can be upladed to maven central… @bjorn, if you are ok with me using my own key rather than yours? then I can see about publishing the version in the master branch to central for you.

That would be perfectly fine with me. Thanks for your help!

---

<div class="post-metadata">

**Author:** ![mikethomas](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/mikethomas/32/1296_2.png) [@mikethomas](https://discourse.mapeditor.org/u/mikethomas)\
**Post date:** [June 23, 2017, 7:13pm UTC](https://discourse.mapeditor.org/t/is-libtiled-java-available-on-any-maven-server/2491/5 "2017-06-23T19:13:56Z")

</div>

> [@bjorn](#):
>
> What a huge change! Looking forward to reviewing it. 😉

It’s not quite ready for prime time just yet but will definately raise a pull request when it is 🙂

> [@bjorn](#):
>
> That would be perfectly fine with me. Thanks for your help!

I have staged a release in [nexus](https://oss.sonatype.org/#nexus-search;gav~org.mapeditor ~~0.17~~ ) (see attached screenshot), if you want to take a look using the login you created for your [jira account](https://issues.sonatype.org/browse/OSSRH-25613):

 ![](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/2X/d/d320618eaa490a19739e20ea92aca22ec80b0256.png)

All that is left to do is click the release button and comment on the jira ticket as it is the first release so that they can start the sync process to central.

let me know if you are happy with what’s in the release (you can view the contents in the “Content” tab you can see in the screenshot) and I’ll start the process to deploy to central.

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [June 24, 2017, 7:58pm UTC](https://discourse.mapeditor.org/t/is-libtiled-java-available-on-any-maven-server/2491/6 "2017-06-24T19:58:12Z")

</div>

> [@mikethomas](#):
>
> let me know if you are happy with what’s in the release (you can view the contents in the “Content” tab you can see in the screenshot) and I’ll start the process to deploy to central.

Contents look fine as far as I can see. What is the purpose of `tiled-parent`?

---

<div class="post-metadata">

**Author:** ![mikethomas](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/mikethomas/32/1296_2.png) [@mikethomas](https://discourse.mapeditor.org/u/mikethomas)\
**Post date:** [June 24, 2017, 9:44pm UTC](https://discourse.mapeditor.org/t/is-libtiled-java-available-on-any-maven-server/2491/7 "2017-06-24T21:44:21Z")

</div>

> [@bjorn](#):
>
> What is the purpose of tiled-parent?

It’s the main project file containing the configuration for libtiled and tmxviewer. It just makes it easier to share common plugins and build config with both modules.

I’ll start the process of deploying now and will let you know when the artefacts are available in maven central 😃

---

<div class="post-metadata">

**Author:** ![mikethomas](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/mikethomas/32/1296_2.png) [@mikethomas](https://discourse.mapeditor.org/u/mikethomas)\
**Post date:** [June 24, 2017, 10:08pm UTC](https://discourse.mapeditor.org/t/is-libtiled-java-available-on-any-maven-server/2491/8 "2017-06-24T22:08:37Z")

</div>

It looks like the release has been completed as the jar files are now available in the central repository:  
[http://central.maven.org/maven2/org/mapeditor/](http://central.maven.org/maven2/org/mapeditor/)

You should now be able to request the jar using the following:

```
<dependency>
    <groupId>org.mapeditor</groupId>
    <artifactId>libtiled</artifactId>
    <version>0.17</version>
</dependency>

```

Let me know if you need anything else 🙂

---

<div class="post-metadata">

**Author:** ![Casper\_Faergemand](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@Casper\_Faergemand](https://discourse.mapeditor.org/u/Casper_Faergemand)\
**Post date:** [June 25, 2017, 4:37am UTC](https://discourse.mapeditor.org/t/is-libtiled-java-available-on-any-maven-server/2491/9 "2017-06-25T04:37:44Z")

</div>

Yep, this works better than the oss.sonatype link, since it lets me get the source for easy browsing.

In the yet-to-be-released version, I assume the xjb files generate the missing classes?

Edit: I stopped trying to use gradle and accepted your maven solution. I got it to compile just fine.

---

<div class="post-metadata">

**Author:** ![Casper\_Faergemand](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@Casper\_Faergemand](https://discourse.mapeditor.org/u/Casper_Faergemand)\
**Post date:** [June 26, 2017, 6:24am UTC](https://discourse.mapeditor.org/t/is-libtiled-java-available-on-any-maven-server/2491/10 "2017-06-26T06:24:43Z")

</div>

@mikethomas Both the original and your version seem to choke on maps that use tsx files that are not at the default path. In the current test code, create a new folder and copy desert.tmx and desert.tsx into it. Then add the following test case:

```
@Test
public void testErrorReadingMap() throws Exception {
    new TMXMapReader().readMap("other/desert.tmx");
}

```

It throws the an error like this in my code:

```
 java.lang.IndexOutOfBoundsException: Index: 16, Size: 1
	at java.util.ArrayList.rangeCheck(ArrayList.java:653)
	at java.util.ArrayList.get(ArrayList.java:429)
	at tiled.core.TileSet.getTile(TileSet.java:419)
	at tiled.io.TMXMapReader.getTileForTileGID(TMXMapReader.java:727)
	at tiled.io.TMXMapReader.setTileAtFromTileId(TMXMapReader.java:713)
	at tiled.io.TMXMapReader.readLayer(TMXMapReader.java:626)
	at tiled.io.TMXMapReader.buildMap(TMXMapReader.java:812)
	at tiled.io.TMXMapReader.unmarshal(TMXMapReader.java:846)
	at tiled.io.TMXMapReader.readMap(TMXMapReader.java:873)

```

I think the issue is that the tsx file is on a path relative to the tmx file, but some other path is searched when the tsx file is attempted loaded. I recall an older version of the code having the same problem. It worked only when the resources were folders named the same as the package structure of the class from which the tmx file was attempted loaded. I’m looking through the source, but I haven’t found the problem yet.

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [June 26, 2017, 7:14am UTC](https://discourse.mapeditor.org/t/is-libtiled-java-available-on-any-maven-server/2491/11 "2017-06-26T07:14:15Z")

</div>

It would be good to report such issues on [the issue tracker](https://github.com/bjorn/tiled/issues).

---

<div class="post-metadata">

**Author:** ![Casper\_Faergemand](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@Casper\_Faergemand](https://discourse.mapeditor.org/u/Casper_Faergemand)\
**Post date:** [June 26, 2017, 7:19am UTC](https://discourse.mapeditor.org/t/is-libtiled-java-available-on-any-maven-server/2491/12 "2017-06-26T07:19:51Z")

</div>

It is done.

[https://github.com/bjorn/tiled/issues/1626](https://github.com/bjorn/tiled/issues/1626)
