private WagonManager m_wagonManager;
public void execute() throws MojoExecutionException
{
MavenProject project = getProject();
if ( !supportedProjectTypes.contains( project.getPackaging() ) )
{
getLog().info( "Ignoring packaging type " + project.getPackaging() );
return;
}
else if ( "NONE".equalsIgnoreCase( obrRepository ) )
{
getLog().info( "OBR update disabled (enable with -DobrRepository)" );
return;
}
URI tempURI = ObrUtils.findRepositoryXml( "", obrRepository );
String repositoryName = new File( tempURI.getPath() ).getName();
Log log = getLog();
ObrUpdate update;
RemoteFileManager remoteFile = new RemoteFileManager( m_wagonManager, settings, log );
remoteFile.connect( repositoryId, url );
// ======== LOCK REMOTE OBR ========
log.info( "LOCK " + remoteFile + '/' + repositoryName );
remoteFile.lockFile( repositoryName, ignoreLock );
File downloadedRepositoryXml = null;
try
{
// ======== DOWNLOAD REMOTE OBR ========
log.info( "Downloading " + repositoryName );
downloadedRepositoryXml = remoteFile.get( repositoryName, ".xml" );
String mavenRepository = localRepository.getBasedir();
URI repositoryXml = downloadedRepositoryXml.toURI();
URI obrXmlFile = ObrUtils.toFileURI( obrXml );
URI bundleJar;
if ( null == file )
{
bundleJar = ObrUtils.findBundleJar( localRepository, project.getArtifact() );
}
else
{
bundleJar = file.toURI();
}
URI remoteBundleURI = null;
if ( null != bundleUrl )
{
remoteBundleURI = URI.create( bundleUrl );
}
else if ( null != file )
{
remoteBundleURI = URI.create( localRepository.pathOf( project.getArtifact() ) );
}
Config userConfig = new Config();
userConfig.setRemoteBundle( remoteBundleURI );
userConfig.setPathRelative( true );