[
https://issues.apache.org/jira/browse/SUREFIRE-1861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17238665#comment-17238665
]
Ernst Reissner commented on SUREFIRE-1861:
------------------------------------------
I give you my config:
```
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<!--forkCount>0</forkCount -->
<useSystemClassLoader>true</useSystemClassLoader>
<useManifestOnlyJar>false</useManifestOnlyJar>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<includes>
<include>TestVersion.java</include>
</includes>
</configuration>
<executions>
<execution>
<id>run-tests</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
```
so you see i did what you say.
then i commanded `{color:#000000}mvn failsafe:integration-test{color}`
but the result was just
```
{color:#000000}[{color}{color:#5454ff}INFO{color}{color:#000000}] Running
eu.simuline.octave.{color}{color:#000000}TestVersion{color}
[{color:#ff5454}ERROR{color}{color:#000000}] {color}{color:#ff5454}Tests
{color}{color:#000000}run: 4{color}{color:#000000},
{color}{color:#ff5454}Failures: 1{color}{color:#000000}, Errors: 0, Skipped: 0,
Time elapsed: 1.589 s{color}{color:#ff5454} <<< FAILURE!{color}{color:#000000}
- in eu.simuline.octave.{color}{color:#000000}TestVersion{color}
[{color:#ff5454}ERROR{color}{color:#000000}]
eu.simuline.octave.TestVersion.testOctaveJavaVersion Time elapsed: 0.142 s
<<< FAILURE! {color}
java.lang.AssertionError: wrong version of octavejava expected:<0.7-SNAPSHOT>
but was:<null>
at
eu.simuline.octave.TestVersion.testOctaveJavaVersion(TestVersion.java:58)
```
coming from the following piece of code:
```
@Test public void testOctaveJavaVersion() {
final OctaveEngine octave = new OctaveEngineFactory().getScriptEngine();
assertEquals("wrong version of octavejava",
"0.7-SNAPSHOT",
octave.getOctaveInJavaVersion());
}
```
with both variants of
```
public String getOctaveInJavaVersion() {
//System.out.println("MANIFEST_INFO: "+MANIFEST_INFO);
//return MANIFEST_INFO.getImplVersion();
return
eu.simuline.octave.OctaveEngine.class.getPackage().getImplementationVersion();
}
```
I want to say something on the documentation
[https://maven.apache.org/surefire/maven-failsafe-plugin/examples/class-loading.html]
It seems only to be on two internal strategies to build a classpath.
I never bring this in a relation to properties in the manifest of a jar file.
Also I dont have problems loading any classes, they load just fine.
The problem is, that the manifest does not 'load'.
A word on debugging output:
I was wrong, yes test classes are a directory always,
but the debug output does not show the jar loaded either.
I think that shall be part of the output in debugging mode.
> 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)