Skip to content

Commit

Permalink
Merge pull request #17 from evgeny-goldin/maven-plugin
Browse files Browse the repository at this point in the history
Maven plugin
  • Loading branch information
Baruch Sadogursky committed Aug 1, 2013
2 parents 37a5882 + 192e9eb commit 180b778
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import org.apache.maven.project.MavenProject
import org.apache.maven.repository.internal.DefaultArtifactDescriptorReader
import org.codehaus.gmaven.mojo.GroovyMojo
import org.gcontracts.annotations.Requires
import org.jfrog.build.client.ClientConfigurationFields
import org.jfrog.build.extractor.maven.BuildInfoRecorder
import org.jfrog.build.extractor.maven.BuildInfoRecorderLifecycleParticipant
import org.sonatype.aether.RepositorySystem
Expand Down Expand Up @@ -160,7 +161,7 @@ class ExtractorMojo extends GroovyMojo
@Requires({ resolver && descriptorReader.artifactResolver && repoSystem.artifactResolver })
private void overrideResolutionRepository ()
{
final String artifactoryUrl = helper.updateValue( resolver.contextUrl )
final String artifactoryUrl = helper.updateValue( resolver.getStringValue( ClientConfigurationFields.CONTEXT_URL )) // Bypassing empty value validator
final String resolutionRepo = helper.updateValue( resolver.repoKey )

if ( artifactoryUrl && resolutionRepo )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ public void deploy(Build build, ArtifactoryClientConfiguration clientConf,
try {
if (StringUtils.isNotBlank(outputFile)) {
logger.info("Artifactory Build Info Recorder: Saving build info to " + outputFile);
BuildInfoExtractorUtils.saveBuildInfoToFile(build, new File(outputFile));
BuildInfoExtractorUtils.saveBuildInfoToFile(build, new File(outputFile).getCanonicalFile());
} else {
File buildInfo = new File(basedir, "target/build-info.json");
BuildInfoExtractorUtils.saveBuildInfoToFile(build, buildInfo);
BuildInfoExtractorUtils.saveBuildInfoToFile(build, buildInfo.getCanonicalFile());
}
} catch (IOException e) {
throw new RuntimeException("Error occurred while persisting Build Info to file.", e);
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,9 @@ project('build-info-extractor-maven3-plugin') {
task pluginDescriptor( type: Exec ) {
// http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.Exec.html

final mvn = project.hasProperty( 'mvn' ) ? project.mvn : 'mvn'
final mvn = project.hasProperty( 'mvn' ) ? project.mvn : System.getProperty( 'os.name' )?.toLowerCase()?.contains( 'win' ) ? 'mvn.bat' : 'mvn'
final mvnArgs = project.hasProperty( 'mvnArgs' ) ? project.mvnArgs : ''
final allArgs = [ '-e', '-B', '-q', mvnArgs, 'org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor' ].grep()
final allArgs = [ '-e', '-B', mvnArgs, 'org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor' ].grep()

executable mvn
args allArgs
Expand Down

0 comments on commit 180b778

Please sign in to comment.