Class ConfigMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.chenile.config.plugin.ConfigMojo
- All Implemented Interfaces:
ContextEnabled, Mojo
@Mojo(name="generate",
requiresProject=true,
defaultPhase=INTEGRATION_TEST,
requiresDependencyResolution=TEST,
threadSafe=true)
public class ConfigMojo
extends AbstractMojo
Generate a Chenile Service Registry configuration from
ChenileConfiguration
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringThe constant GET.private static final StringThe name of the info service (this will be excluded)private StringThe URL from where the api doc is retrieved.private static final tools.jackson.databind.ObjectMapperprivate FileOutput directory for the generated Service registry JSON.private MavenProjectThe Project.private MavenProjectHelperThe Project helper.private StringThe URL from where the api doc is retrieved.private booleanSkip execution if set to true.private boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()private byte[]makeGetCall(String url) private List<Info.ServiceInfo> private voidprocessService(String name) private ByteArrayOutputStreamreadFully(InputStream inputStream) Read fully byte array output stream.private StringreadFullyAsString(InputStream inputStream) Read fully as string string.Methods inherited from class AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
INFO_SERVICE_NAME
The name of the info service (this will be excluded)- See Also:
-
infoUrl
@Parameter(defaultValue="http://localhost:8080/info", property="org.chenile.config.plugin.infoUrl", required=true) private String infoUrlThe URL from where the api doc is retrieved. -
serviceInfoUrlPrefix
@Parameter(defaultValue="http://localhost:8080/service-info/", property="org.chenile.config.plugin.serviceInfoUrlPrefix", required=true) private String serviceInfoUrlPrefixThe URL from where the api doc is retrieved. -
outputDir
@Parameter(defaultValue="${project.build.directory}/service-registry", property="org.chenile.config.plugin.outputDir", required=true) private File outputDirOutput directory for the generated Service registry JSON. -
project
The Project. -
skip
Skip execution if set to true. Default is false. -
skipInfoService
@Parameter(defaultValue="true", property="org.chenile.config.plugin.skipInfoService") private boolean skipInfoService -
projectHelper
The Project helper. -
GET
-
objectMapper
private static final tools.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Details
-
ConfigMojo
public ConfigMojo()
-
-
Method Details
-
execute
public void execute() -
obtainServices
-
makeGetCall
-
processService
-
readFullyAsString
Read fully as string string.- Parameters:
inputStream- the input stream- Returns:
- the string
- Throws:
IOException- the io exception
-
readFully
Read fully byte array output stream.- Parameters:
inputStream- the input stream- Returns:
- the byte array output stream
- Throws:
IOException- the io exception
-
CHENILE