'How to keep contents in variable between the executions (Mojo)
Need some help!
I need to keep the variable contents between executions (Mojo). Is this possible?
This is the variable that I need to keep the content:
@Mojo (name = "genschema", defaultPhase = LifecyclePhase.COMPILE)
public class JsonSchemaGen extends AbstractMojo
{
::
::
private static final Map<String, ArrayList<String>> hookingElements = new HashMap<>();
This example of my pom.xml
<plugin>
<groupId>com.xxx.yyy</groupId>
<artifactId>test</artifactId>
<configuration>
<executions>
<execution>
<schema>test.json</schemaFile>
::
::
</execution>
<execution>
<schemaFile>teste1.json</schemaFile>
::
::
</execution>
<execution>
<schemaFile>test2.json</schemaFile>
::
::
</execution>
</executions>
</configuration>
Solution 1:[1]
I need to keep the variable contents between executions
The way to do this is to save the value in a more permanent location such as a file or database.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Code-Apprentice |
