Author: mcculls
Date: Sun Feb 17 21:24:46 2008
New Revision: 628622
URL: http://svn.apache.org/viewvc?rev=628622&view=rev
Log:
FELIX-491: add bundle:deploy to bundle lifecycle (off by default, use
-DremoteOBR to enable)
Modified:
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrCleanRepo.java
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstallFile.java
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrUtils.java
felix/trunk/bundleplugin/src/main/resources/META-INF/plexus/components.xml
Modified:
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrCleanRepo.java
URL:
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrCleanRepo.java?rev=628622&r1=628621&r2=628622&view=diff
==============================================================================
---
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrCleanRepo.java
(original)
+++
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrCleanRepo.java
Sun Feb 17 21:24:46 2008
@@ -81,9 +81,9 @@
public void execute()
{
- if ( "NONE".equalsIgnoreCase( obrRepository ) )
+ if ( "NONE".equalsIgnoreCase( obrRepository ) ||
"false".equalsIgnoreCase( obrRepository ) )
{
- getLog().info( "OBR clean disabled (enable with -DobrRepository)"
);
+ getLog().info( "Local OBR clean disabled (enable with
-DobrRepository)" );
return;
}
Modified:
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java
URL:
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java?rev=628622&r1=628621&r2=628622&view=diff
==============================================================================
---
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java
(original)
+++
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java
Sun Feb 17 21:24:46 2008
@@ -53,7 +53,14 @@
private boolean ignoreLock;
/**
- * OBR Repository.
+ * Remote OBR Repository.
+ *
+ * @parameter expression="${remoteOBR}" default-value="NONE"
+ */
+ private String remoteOBR;
+
+ /**
+ * Local OBR Repository.
*
* @parameter expression="${obrRepository}"
*/
@@ -122,13 +129,19 @@
getLog().info( "Ignoring packaging type " + project.getPackaging()
);
return;
}
- else if ( "NONE".equalsIgnoreCase( obrRepository ) )
+ else if ( "NONE".equalsIgnoreCase( remoteOBR ) ||
"false".equalsIgnoreCase( remoteOBR ) )
{
- getLog().info( "OBR update disabled (enable with -DobrRepository)"
);
+ getLog().info( "Remote OBR update disabled (enable with
-DremoteOBR)" );
return;
}
- URI tempURI = ObrUtils.findRepositoryXml( "", obrRepository );
+ // if the user doesn't supply an explicit name for the remote OBR
file, use the local name instead
+ if ( null == remoteOBR || remoteOBR.trim().length() == 0 ||
"true".equalsIgnoreCase( remoteOBR ) )
+ {
+ remoteOBR = obrRepository;
+ }
+
+ URI tempURI = ObrUtils.findRepositoryXml( "", remoteOBR );
String repositoryName = new File( tempURI.getPath() ).getName();
Log log = getLog();
Modified:
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java
URL:
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java?rev=628622&r1=628621&r2=628622&view=diff
==============================================================================
---
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java
(original)
+++
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java
Sun Feb 17 21:24:46 2008
@@ -51,7 +51,14 @@
private boolean ignoreLock;
/**
- * OBR Repository.
+ * Remote OBR Repository.
+ *
+ * @parameter expression="${remoteOBR}"
+ */
+ private String remoteOBR;
+
+ /**
+ * Local OBR Repository.
*
* @parameter expression="${obrRepository}"
*/
@@ -123,13 +130,19 @@
getLog().info( "Ignoring packaging type " + project.getPackaging()
);
return;
}
- else if ( "NONE".equalsIgnoreCase( obrRepository ) )
+ else if ( "NONE".equalsIgnoreCase( remoteOBR ) ||
"false".equalsIgnoreCase( remoteOBR ) )
{
- getLog().info( "OBR update disabled (enable with -DobrRepository)"
);
+ getLog().info( "Remote OBR update disabled (enable with
-DremoteOBR)" );
return;
}
- URI tempURI = ObrUtils.findRepositoryXml( "", obrRepository );
+ // if the user doesn't supply an explicit name for the remote OBR
file, use the local name instead
+ if ( null == remoteOBR || remoteOBR.trim().length() == 0 ||
"true".equalsIgnoreCase( remoteOBR ) )
+ {
+ remoteOBR = obrRepository;
+ }
+
+ URI tempURI = ObrUtils.findRepositoryXml( "", remoteOBR );
String repositoryName = new File( tempURI.getPath() ).getName();
Log log = getLog();
Modified:
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java
URL:
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java?rev=628622&r1=628621&r2=628622&view=diff
==============================================================================
---
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java
(original)
+++
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java
Sun Feb 17 21:24:46 2008
@@ -83,9 +83,9 @@
getLog().info( "Ignoring packaging type " + project.getPackaging()
);
return;
}
- else if ( "NONE".equalsIgnoreCase( obrRepository ) )
+ else if ( "NONE".equalsIgnoreCase( obrRepository ) ||
"false".equalsIgnoreCase( obrRepository ) )
{
- getLog().info( "OBR update disabled (enable with -DobrRepository)"
);
+ getLog().info( "Local OBR update disabled (enable with
-DobrRepository)" );
return;
}
Modified:
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstallFile.java
URL:
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstallFile.java?rev=628622&r1=628621&r2=628622&view=diff
==============================================================================
---
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstallFile.java
(original)
+++
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstallFile.java
Sun Feb 17 21:24:46 2008
@@ -74,9 +74,9 @@
getLog().info( "Ignoring packaging type " + project.getPackaging()
);
return;
}
- else if ( "NONE".equalsIgnoreCase( obrRepository ) )
+ else if ( "NONE".equalsIgnoreCase( obrRepository ) ||
"false".equalsIgnoreCase( obrRepository ) )
{
- getLog().info( "OBR update disabled (enable with -DobrRepository)"
);
+ getLog().info( "Local OBR update disabled (enable with
-DobrRepository)" );
return;
}
Modified:
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrUtils.java
URL:
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrUtils.java?rev=628622&r1=628621&r2=628622&view=diff
==============================================================================
---
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrUtils.java
(original)
+++
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrUtils.java
Sun Feb 17 21:24:46 2008
@@ -23,6 +23,7 @@
import java.net.URI;
import java.util.Collection;
import java.util.Iterator;
+import java.util.regex.Pattern;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
@@ -50,8 +51,10 @@
{
String targetPath = obrRepository;
+ Pattern ignoredNames = Pattern.compile( "^(true|false|none|null)?$",
Pattern.CASE_INSENSITIVE );
+
// Combine location settings into a single repository location
- if ( null == targetPath || targetPath.trim().length() == 0 ||
"true".equalsIgnoreCase( targetPath ) )
+ if ( null == targetPath || ignoredNames.matcher( targetPath
).matches() )
{
targetPath = mavenRepository + '/' + REPO_XML;
}
Modified:
felix/trunk/bundleplugin/src/main/resources/META-INF/plexus/components.xml
URL:
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/resources/META-INF/plexus/components.xml?rev=628622&r1=628621&r2=628622&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/resources/META-INF/plexus/components.xml
(original)
+++ felix/trunk/bundleplugin/src/main/resources/META-INF/plexus/components.xml
Sun Feb 17 21:24:46 2008
@@ -39,8 +39,8 @@
org.apache.felix:maven-bundle-plugin:install
</install>
<deploy>
- org.apache.maven.plugins:maven-deploy-plugin:deploy<!--,
- TODO: org.apache.felix:maven-bundle-plugin:deploy-->
+ org.apache.maven.plugins:maven-deploy-plugin:deploy,
+ org.apache.felix:maven-bundle-plugin:deploy
</deploy>
</phases>
<!-- END SNIPPET: bundle-lifecycle -->