[Solved] Cannot resolve symbol 'PomData'

I just started Sponge Plugin development and do not have much experience with Java development. So please forgive me my rookie question.

I forked an existing Plugin (LanDiscovery) and was able to “fix” it so that it will work with SpongeVanilla. I’m using IDEA 15 and used File -> New -> Project from Version Control -> Git.

Here is my problem (> Cannot resolve symbol 'PomData'):

`/**

  • A simple sponge plugin
    */
    @Plugin(id = PomData.ARTIFACT_ID, name = PomData.NAME, version = PomData.VERSION)
    public class LanDiscoveryPlugin {`

I found the class description in the following location, but within the project no usage.

\LanDiscovery\src\main\java-templates\ninja\leaping\landiscovery\PomData.java

So I guess I’m doing something wrong. The maven dependencies are loaded. Do I have to add a dependency manually? I found this at stackoverflow: “PomData cannot be resolved to a variable” - but if I add this to the project code somewhere I will also include it in my pull request or skip it somehow. That seems wrong to me.

I’ve seen this (PomData.*) in several other plugins. So I assume that this is probably an ordinary task that I do not know yet.

Thanks in advance.

Looks like that project uses the sponge archetype

I don’t have any experience with archetype/maven but it may help to read the README file

PomData is a generated source file – you’ll have to build the project first so that is generated. Just run mvn clean installfrom the project directory (IntelliJ probably has a way to build a maven target as well)

Also, what issue are you having with LanDiscovery? There don’t seem to be any build errors currently and I’ve tested it on SpongeVanilla in the past, so it should work fine.

Ok, I’ve looked at LanDiscovery. It looks like I forgot to push the necessary changes – the latest git now has the appropriate fixes.

I downloaded the source, build the jar and it didn’t work for me. I looked at the SpongeVanilla code and have not found code that fired the GamePreInitializationEvent (maybe because I’m new to this and just spend two days of reading doc, code, etc) so I changed it to GameStartedServerEvent. Still nothing (I added logger.info messages after socket.send in LanThread->run()). I compared with my own ‘Hello World’ test plugins and had the idea of changing from private to public for onPreInit(), onServerStarted() and disable() - and after that change the plugin works for me.

More rookie mistakes by me?

I’ll now try the mvn clean install.

Ok, it looks like someone changed how event listeners are registered so private methods are no longer considered to run events with. I’m releasing version 1.0.1 to work with the latest Sponge versions.

mvn clean install sucessfully builds after 3878158 and the plugin now works on SpongeVanilla with 52bb63d. Thank you.

/solved