Open
Description
Hey, fairly new to Spoon here.
I'm using Lombok to generate constructors for me on this class:
import lombok.*;
@Getter
@Setter
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
public class SourceData {
private SystemID systemID = SystemID.UNDEFINED;
private ServiceID serviceID = ServiceID.UNDEFINED;
private SourceType sourceType = SourceType.UNKNOWN;
//using Lombok generated constructor (erroring here)
public static final SourceData UNDEFINED = new SourceData(
SystemID.UNDEFINED,
ServiceID.UNDEFINED,
SourceType.UNKNOWN);
}
I'm trying to use the maven plugin to add another layer of functions to the class,
but when I compile I get the error:
...
[INFO] --- spoon-maven-plugin:3.4.2:generate (default) @ entity ---
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by fr.inria.gforge.spoon.util.ClasspathHacker (file:/C:/Users/111770/.m2/repository/fr/inria/gforge/spoon/spoon-maven-plugin/3.4.2/spoon-maven-plugin-3.4.2.jar) to method java.net.URLClassLoader.addURL(java.net.URL)
WARNING: Please consider reporting this to the maintainers of fr.inria.gforge.spoon.util.ClasspathHacker
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Running in NOCLASSPATH mode (doc: http://spoon.gforge.inria.fr/launcher.html).
[INFO] Running in FULLCLASSPATH mode (doc: http://spoon.gforge.inria.fr/launcher.html).
[INFO] Spoon version 8.1.0
[INFO] running Spoon...
[INFO] start processing...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.188 s
[INFO] Finished at: 2021-03-03T19:07:14-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal fr.inria.gforge.spoon:spoon-maven-plugin:3.4.2:generate (default) on project entity: Exception during the spoonify of the target project.: The constructor SourceData(SystemID, ServiceID, SourceType) is undefined at D:\data\entityGenerator\src\main\java\com\entity\SourceData.java:51 -> [Help 1]
...
I'm assuming that this is because the Launcher
doesn't know how to handle the all args constructor that would have been generated, but isn't, because this is source code.
So my question is, is there a maven plugin configuration in which I can make this still work? Is there a way to configure the pom.xml so that the spoon-maven-plugin analyzes the compiled bytecode?