[
https://issues.apache.org/jira/browse/SUREFIRE-1861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17236237#comment-17236237
]
Ernst Reissner commented on SUREFIRE-1861:
------------------------------------------
Maybe it is ok to give less than a whole project.
Assume there is a method
```
public String getOctaveInJavaVersion() {
return this.getClass().getPackage().getImplementationVersion();
}
```
This returns the implementation version,
but only, if the jar from which this class is loaded
contains some file `META-INF/MANIFEST.MF`
which has a section which looks somehow like that:
```
Name: eu/simuline/octave/
Extension-name: eu.simuline.octave
Specification-Version: 0.7
Implementation-Version: 0.7.1-SNAPSHOT
```
Here, eu.simuline.octave is the package of the above class.
As said, this works fine but cannot be tested:
with surefire plugin, it cannot be tested because it runs in phase test
where no jar is created yet.
In contrast, failsafe plugin, testing in phase integration-test has a jar
available.
Nevertheless, it uses still the unpackaged classes to load.
Thus a test on the version does not work in any test plugin.
I would suggest to at least allow test based on the jar created.
> failsafe shall use jar
> ----------------------
>
> Key: SUREFIRE-1861
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1861
> Project: Maven Surefire
> Issue Type: Improvement
> Components: Maven Failsafe Plugin
> Affects Versions: 3.0.0-M5
> Environment: all
> Reporter: Ernst Reissner
> Priority: Critical
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> To run tests based on information stored in jar only but not in
> testClassesDirectory,
> the plugin shall load classes from the jar instead.
> That way, one could check also presence of vendor information,
> or versions, or git state or whatsoever meta information
> to be supplied to the user and stored in the jar.
>
> The jar is always available though since we are in a late lifecycle phase.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)