[
https://issues.apache.org/jira/browse/FELIX-3035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13109820#comment-13109820
]
Richard S. Hall commented on FELIX-3035:
----------------------------------------
Even then this would create a situation where it would be difficult to compile
Felix without Maven since this Version class would need to be generated before
you could compile, otherwise the symbol would be missing for the compile.
What we really want is to add something like this in Felix.java:
public class Felix ... {
private static final String m_frameworkVersion = "${pom.version}";
...
}
Then at compile time we just need to get this variable substituted before
generating the Felix.class file. This is the most direct approach, eliminates
any I/O, and still makes it possible to compile Felix without Maven since there
is no dependency on another artifact. Additionally, our code can check to see
if "${pom.version}" was substituted or not and use "0.0.0" instead if it
wasn't, similar to what we do now in Felix.getFrameworkVersion().
Not sure if this is possible with Maven or not. Maybe some Maven expert has
some advice.
> Make Felix version a compile time constant
> ------------------------------------------
>
> Key: FELIX-3035
> URL: https://issues.apache.org/jira/browse/FELIX-3035
> Project: Felix
> Issue Type: Improvement
> Components: Framework
> Affects Versions: framework-3.2.2
> Reporter: Sahoo
> Assignee: Sahoo
> Fix For: framework-4.0.0
>
> Attachments: FELIX-3035-patch.txt
>
>
> Currently there is unnecessary IO done to read Felix version from a
> properties file. It could easily be a compile time constant by doing some
> code generation at build time.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira