PackageVersion imports in various packages (maybe all of them)

8 views
Skip to first unread message

M. Tarık Yurt

unread,
Jun 8, 2015, 10:48:13 AM6/8/15
to jacks...@googlegroups.com
Hi,
Recently, I started to play on jaxrs-providers module. I'm having some problem with PackageVersion imports. The same thing happened in hibernate module also. PackageVersion seems to be absent in the class path, also there is a PackageVersion.java.in file in every package. IDE tells me to import the ProjectVersion class from com.fasterxml.jackson.core.json, com.fasterxml.jackson.databind.cfg, or com.fasterxml.jackson.module.jaxb. I see that these .in classes are generated by Maven plugin. The questions I have:
  • Why? What is the ultimate reason behind using PackageVersion usage?
  • How does this code compile in a single clone operation? I couldn't do it.
  • What should I do to continue development in the package?
Best regards,
-Tarik

Tatu Saloranta

unread,
Jun 8, 2015, 1:17:00 PM6/8/15
to jacks...@googlegroups.com
To generate these classes you will need to do 'mvn install' (or perhaps 'mvn compile' is enough) from command line (or force via IDE maven plugin)?
The reason these are generated is to inject Maven version number from pom.xml into templated version of the class, which is then simple and efficient to access programmatically.

Earlier we instead included a simple text file (VERSION.txt) that had this information, but it turned out to be a significant problem for Android usage, due to oddities of Android platform (any resource files that exist not only live in memory, but for some reason or other end up including the whole jar contents it seems).

I don't know if there is a way to make IDE auto-run everything needed; if anyone knows, please share.
I haven't had much problems with Eclipse or Idea, but I tend to always run initial install from command-line.

-+ Tatu +-


--
You received this message because you are subscribed to the Google Groups "jackson-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jackson-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

M. Tarık Yurt

unread,
Jun 11, 2015, 12:21:34 PM6/11/15
to jacks...@googlegroups.com
Thank you, I have managed to do it easily in Intellij IDEA, by Maven generate sources command.
Reply all
Reply to author
Forward
0 new messages