Closed Michael2109 closed 4 years ago
Hmm, I don't see how this can happen. Would it be possible to upload an archive with all the relevant files, to make the problem easier to reproduce?
You do mean the TMXMapReader at https://github.com/bjorn/tiled/tree/master/util/java/libtiled-java/src/main/java/org/mapeditor/io, right?
TMXMapReader
in org.mapeditor.
My gradle:
// https://mvnrepository.com/artifact/org.mapeditor/libtiled
compile group: 'org.mapeditor', name: 'libtiled', version: '0.17'
Sorry this was a while before I had to change to the LibGDX tiled parser so I can't give any more code. To reproduce you should just need to create all of the 7 tilesets (like the examples above) and parse it. It should have the empty
tileset instead of the outdoor
tilesets.
I think this bug was already fixed in change 14a9ffa9e0b5731cd968107cfa4810a742c529e9, but probably that fix isn't in the MVN repository yet.
@mikepthomas Could you help with pushing a new release of libtiled there? I'm sorry but I'm still clueless about how to get that updated. Ideally it would trigger from AppVeyor or Travis CI on release tags...
Could you help with pushing a new release of libtiled there?
Sure I have pushed a copy of the latest master branch to Nexus SNAPSHOTS, you can get hold of it using the following in your Maven 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>1.0.2-SNAPSHOT</version>
<type>jar</type>
</dependency>
...
</dependencies>
or for gradle:
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
implementation 'org.mapeditor:libtiled:1.0.2-SNAPSHOT'
}
Once you're happy with the build let me know and Ill trigger the process of pushing it to Maven Central.
Ideally it would trigger from AppVeyor or Travis CI on release tags...
Yes this would be great, however to get approval to push to Central the assets need to be signed with a PGP key, at the moment I am using my personal one... ~I don't know if you are able to set up GPG on AppVeyor or Travis as you would need to store the private key secuely in some way.~ It looks like it is possible to do with Travis, the process is a bit involved, https://www.phillip-kruger.com/post/continuous_integration_to_maven_central/ I could take a look hopefully this weekend if I get some time. @bjorn, you may need to upload the key to travis as I do not have access unfortunately. Hope this helps :)
@mikepthomas I tried to check the build, but the mvn clean install
command if failing me for some reason. Do you know what may be causing this?
bjorn@thor:~/projects/tiled/util/java$ mvn clean install
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Tiled
[INFO] libtiled
[INFO] tmxviewer
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tiled 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ tiled-parent ---
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ tiled-parent ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ tiled-parent ---
[INFO] Installing /home/bjorn/projects/tiled/util/java/pom.xml to /home/bjorn/.m2/repository/org/mapeditor/tiled-parent/1.0-SNAPSHOT/tiled-parent-1.0-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building libtiled 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ libtiled ---
[INFO] Deleting /home/bjorn/projects/tiled/util/java/libtiled-java/target
[INFO]
[INFO] --- maven-jaxb2-plugin:0.13.2:generate (default) @ libtiled ---
[WARNING] The POM for org.glassfish.jaxb:jaxb-runtime:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.glassfish.jaxb:jaxb-core:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.glassfish.jaxb:txw2:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.glassfish.jaxb:jaxb-xjc:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.glassfish.jaxb:codemodel:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.sun.xml.bind.external:rngom:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.sun.istack:istack-commons-tools:jar:2.21 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Failed to build parent project for com.sun.xml.bind.mvn:jaxb-bundles:pom:2.2.11
[WARNING] Failed to build parent project for com.sun.xml.bind:jaxb-xjc:jar:2.2.11
[WARNING] Invalid POM for com.sun.xml.bind:jaxb-xjc:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Failed to build parent project for com.sun.xml.bind.mvn:jaxb-bundles:pom:2.2.11
[WARNING] Failed to build parent project for com.sun.xml.bind:jaxb-core:jar:2.2.11
[WARNING] Invalid POM for com.sun.xml.bind:jaxb-core:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] Up-to-date check for source resources [[file:/home/bjorn/projects/tiled/util/java/libtiled-java/src/main/resources/map.xsd, file:/home/bjorn/projects/tiled/util/java/libtiled-java/src/main/resources/bindings.xjb, file:/home/bjorn/projects/tiled/util/java/libtiled-java/pom.xml]] and target resources [[]].
[INFO] Sources are not up-to-date, XJC will be executed.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Tiled .............................................. SUCCESS [ 0.474 s]
[INFO] libtiled ........................................... FAILURE [ 1.142 s]
[INFO] tmxviewer .......................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.749 s
[INFO] Finished at: 2019-03-12T10:42:25+01:00
[INFO] Final Memory: 14M/60M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.2:generate (default) on project libtiled: Execution default of goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.2:generate failed: Prefix '' is already bound to '' -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :libtiled
And maybe some version info helps:
bjorn@thor:~/projects/tiled/util/java/libtiled-java$ mvn --version
Apache Maven 3.5.2
Maven home: /usr/share/maven
Java version: 10.0.2, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-46-generic", arch: "amd64", family: "unix"
My guess is the Java version you are using... it should build fine under JDK 1.8, I have yet to try building using versions later than this as jaxb has been deprecated in version 9 https://www.jesperdj.com/2018/09/30/jaxb-on-java-9-10-11-and-beyond/ the version I used to build the snapshot in OSS is:
$ java -version ✔
openjdk version "1.8.0_202"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_202-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.202-b08, mixed mode)
My guess is the Java version you are using... it should build fine under JDK 1.8, I have yet to try building using versions later than this as jaxb has been deprecated in version 9
Ah, so that's issue #2048 then. How feasible do you think it is to drop JAXB? Is that a dependency you introduced?
Feel free to push this version to Maven Central in the meantime, since it's at least better than the version currently released there.
It should be able to be added back in to later versions of Java from Maven using:
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
From what I believe it has only been deprecated in the JDK to slim it down as it was originally designed as a Java EE feature for XML based web services. Its currently being used to auto generate some Classes from the XML schema that was made.
Latest version is now available in Maven Central https://search.maven.org/artifact/org.mapeditor/libtiled/1.0.2/jar
@mikepthomas Thanks! Just out of curiosity, where does the version "1.0.2" come from?
@Michael2109 Can you try whether the bug you reported was fixed when using this version of libtiled?
where does the version "1.0.2" come from?
When I have made changes, I open the Maps in src/test/resources with the latest version of Tiled and re-save them, I also update the xml schema in src/main/resources with any additions in http://doc.mapeditor.org/en/latest/reference/tmx-map-format so it should be able to read maps produced up to that version of Tiled (with some features not implemented). I'd like to update the library more but am struggling to find time atm. I have however, managed to get it building in Java 11, with a few warnings... expect to see a PR coming soon ;)
Closing this since the bug is likely fixed and we're unlikely to still get a confirmation @Michael2109.
I've been using the
TMXMapReader
to parse a.tmx
file. I've noticed that any ids of1
in thedata
is being set as theempty
tileset instead of theoutdoor
tileset..tmx
Outdoor tileset
Empty tileset
Currently I can fix it by switching the order of the
tileset
declarations.Fixed .tmx
What could be causing this?