Skip to content

Commit

Permalink
Merge pull request #24 from rmpestano/master
Browse files Browse the repository at this point in the history
Adds ability to change directory where resources are generated; resolves #13;
  • Loading branch information
sdaschner authored Dec 22, 2016
2 parents efa431b + 1a575bc commit 3680458
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ public class JAXRSAnalyzerMojo extends AbstractMojo {
*/
private List<RemoteRepository> remoteRepos;


/**
* Path, relative to outputDir, to generate resources
*
* @parameter default-value="jaxrs-analyzer" property="jaxrs-analyzer.resourcesDir"
*/
private String resourcesDir;

@Override
public void execute() throws MojoExecutionException {
injectMavenLoggers();
Expand All @@ -166,12 +174,14 @@ public void execute() throws MojoExecutionException {
LogProvider.debug("Source paths are: " + sourcePaths);

// create target sub-directory
final File resourcesDirectory = Paths.get(buildDirectory.getPath(), "jaxrs-analyzer").toFile();
final File resourcesDirectory = Paths.get(buildDirectory.getPath(), resourcesDir).toFile();
if (!resourcesDirectory.exists() && !resourcesDirectory.mkdirs())
throw new MojoExecutionException("Could not create directory " + resourcesDirectory);

final Path fileLocation = resourcesDirectory.toPath().resolve(backendType.getFileLocation());

LogProvider.info("Generating resources at " + fileLocation.toAbsolutePath());

// start analysis
final long start = System.currentTimeMillis();
new JAXRSAnalyzer(projectPaths, sourcePaths, classPaths, project.getName(), project.getVersion(), backend, fileLocation).analyze();
Expand Down

0 comments on commit 3680458

Please sign in to comment.