-
Notifications
You must be signed in to change notification settings - Fork 15
Compile Jar Package
Evosuite++ follows the pom.xml in Evosuite with additional customization.
We recommend to use clean source:jar install -Ppackage-jars -T 4
(skip tests to save time) to create new jar file.
You will find the jar files are generated under generated-jars folder under the project.
In eclipse, we need to import Evosuite projects by Import>>Maven>>Existing Maven Projects. In general, we may import the following projects for compiling Evosuite:
- evosuite
- evosuite-client
- evosuite-master
- evosuite-runtime
- evosuite-shell
EvoSuite++ supports JDK1.8. We are working on the project to support the above version.
After importing all the above projects, we need to modify pom.xml in evosuite project as follows (here is an Eclipse bug, which makes the IDE fail to recognize correct Java home path even if we set the correct JDK path in Eclipse, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=432992):
We find <tools-default>
and replace its <exists>
and <toolsjar>
element with the file location inside
project.
For example:
<id>tools-default</id>
<activation>
<activeByDefault>true</activeByDefault>
<file>
<exists>C:\Program Files\Java\jdk1.8.0_261\libs\tools.jar</exists>
</file>
</activation>
</properties>
<toolsjar>C:\Program Files\Java\jdk1.8.0_261\libs\tools.jar</toolsjar>
</properties>
A more systematic way to resolve the problem is to use customized maven settings where the java.home
environment is manually defined. Technically, you should customize your IDE (e.g., eclipse) to use the downloaded maven, where the conf\settings.xml be set as
<profiles>
<profile>
<id>compiler</id>
<properties>
<java.home>C:\Program Files\Java\jdk1.8.0_202\bin</java.home>
</properties>
</profile>
<profiles>
<activeProfiles>
<activeProfile>compiler</activeProfile>
</activeProfiles>
Then, right click the project >> Maven >> Ipdate Project ... By this means, the problem can be fixed.
To work on EvoSuite++ source code (forked from EvoSuite project by Prof. Gordon Fraser), we need to compile Evosuite to generate some source code. We suggest to remove the dependency of evosuite-master component on evosuite-client-test (i.e., the evosuite-client test-jar file) to compile the source code first. The maven command to compile EvoSuite++ is:
mvn clean source:jar install -Ppackage-jars -T 4
After compilation, the "evosuite-master" project may have some compilation errors. In this case, we may include the target/generated-sources/jaxb
folder as build path.