Class UploadMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.appng.maven.plugins.appngizer.UploadMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="upload", defaultPhase=PACKAGE) public class UploadMojo extends org.apache.maven.plugin.AbstractMojo
-
-
Field Summary
Fields Modifier and Type Field Description protected String
baseAuthPassword
protected String
baseAuthUser
protected URL
endpoint
protected File
file
protected String
repository
protected org.springframework.web.client.RestTemplate
restTemplate
protected String
sharedSecret
protected String
targetFile
protected File
targetFolder
-
Constructor Summary
Constructors Constructor Description UploadMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
debugBody(Object o, org.springframework.http.MediaType mediaType)
protected void
determineFile()
void
execute()
protected org.springframework.http.HttpHeaders
getHeader()
protected org.springframework.http.ResponseEntity<Repository>
getRepository()
protected void
login()
protected <T> org.springframework.http.ResponseEntity<T>
send(Object requestObject, org.springframework.http.HttpHeaders header, org.springframework.http.HttpMethod method, String path, Class<T> resultType)
protected <T> org.springframework.http.ResponseEntity<T>
send(Object requestObject, org.springframework.http.HttpHeaders header, org.springframework.http.HttpMethod method, String path, Class<T> resultType, boolean throwErrorOn4xx)
protected org.springframework.http.ResponseEntity<Package>
upload()
protected org.springframework.http.ResponseEntity<Package>
upload(boolean install, boolean privileged, boolean hidden)
-
-
-
Field Detail
-
sharedSecret
@Parameter(property="sharedSecret", defaultValue="loreipsum", required=true) protected String sharedSecret
-
repository
@Parameter(property="repository", defaultValue="Local", required=true) protected String repository
-
endpoint
@Parameter(property="endpoint", defaultValue="http://localhost:8080/appNGizer/", required=true) protected URL endpoint
-
file
protected File file
-
targetFolder
@Parameter(defaultValue="${project.build.directory}", readonly=true) protected File targetFolder
-
targetFile
@Parameter(defaultValue="${project.artifactId}-${project.version}", readonly=true) protected String targetFile
-
baseAuthUser
@Parameter(property="baseAuthUser") protected String baseAuthUser
-
baseAuthPassword
@Parameter(property="baseAuthPassword") protected String baseAuthPassword
-
restTemplate
protected org.springframework.web.client.RestTemplate restTemplate
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
send
protected <T> org.springframework.http.ResponseEntity<T> send(Object requestObject, org.springframework.http.HttpHeaders header, org.springframework.http.HttpMethod method, String path, Class<T> resultType) throws URISyntaxException, org.apache.maven.plugin.MojoExecutionException
- Throws:
URISyntaxException
org.apache.maven.plugin.MojoExecutionException
-
send
protected <T> org.springframework.http.ResponseEntity<T> send(Object requestObject, org.springframework.http.HttpHeaders header, org.springframework.http.HttpMethod method, String path, Class<T> resultType, boolean throwErrorOn4xx) throws URISyntaxException, org.apache.maven.plugin.MojoExecutionException
- Throws:
URISyntaxException
org.apache.maven.plugin.MojoExecutionException
-
debugBody
protected void debugBody(Object o, org.springframework.http.MediaType mediaType)
-
getHeader
protected org.springframework.http.HttpHeaders getHeader()
-
login
protected void login() throws URISyntaxException, org.apache.maven.plugin.MojoExecutionException
- Throws:
URISyntaxException
org.apache.maven.plugin.MojoExecutionException
-
getRepository
protected org.springframework.http.ResponseEntity<Repository> getRepository() throws URISyntaxException, org.apache.maven.plugin.MojoExecutionException
- Throws:
URISyntaxException
org.apache.maven.plugin.MojoExecutionException
-
upload
protected org.springframework.http.ResponseEntity<Package> upload() throws URISyntaxException, InterruptedException, ExecutionException
-
upload
protected org.springframework.http.ResponseEntity<Package> upload(boolean install, boolean privileged, boolean hidden) throws URISyntaxException, InterruptedException, ExecutionException
-
determineFile
protected void determineFile() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-