You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by pd...@apache.org on 2006/06/21 20:56:07 UTC
svn commit: r416068 - in /incubator/servicemix/trunk/tooling: ./
jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/
servicemix-service-unit/src/main/resources/archetype-resources/
servicemix-shared-library/ servicemix-shared-library...
Author: pdodds
Date: Wed Jun 21 11:56:05 2006
New Revision: 416068
URL: http://svn.apache.org/viewvc?rev=416068&view=rev
Log:
Updated the handling of the components to factor in support for determining automatically if a dependency is a shared library and referencing it as one in jbi.xml. Also updated the service assembly so that a dependency doesn't need to have type jbi-service-unit as the plugin checked the artifacts POM for packaging. Also added an archetype for the shared library for completeness
Added:
incubator/servicemix/trunk/tooling/servicemix-shared-library/ (with props)
incubator/servicemix/trunk/tooling/servicemix-shared-library/pom.xml
incubator/servicemix/trunk/tooling/servicemix-shared-library/src/
incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/
incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/
incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/META-INF/
incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/META-INF/maven/
incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/META-INF/maven/archetype.xml
incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/archetype-resources/
incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/archetype-resources/pom.xml
incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/archetype-resources/src/
incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/archetype-resources/src/main/
incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/archetype-resources/src/main/resources/
Modified:
incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/DependencyInformation.java
incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateComponentDescriptorMojo.java
incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java
incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateSharedLibraryDescriptorMojo.java
incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateSharedLibraryMojo.java
incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiComponentDescriptorWriter.java
incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceAssemblyDescriptorWriter.java
incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiSharedLibraryDescriptorWriter.java
incubator/servicemix/trunk/tooling/pom.xml
incubator/servicemix/trunk/tooling/servicemix-service-unit/src/main/resources/archetype-resources/pom.xml
Modified: incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/DependencyInformation.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/DependencyInformation.java?rev=416068&r1=416067&r2=416068&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/DependencyInformation.java (original)
+++ incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/DependencyInformation.java Wed Jun 21 11:56:05 2006
@@ -23,7 +23,7 @@
*/
public class DependencyInformation {
- private String artifactZip;
+ private String filename;
private String component;
@@ -33,8 +33,18 @@
private String version;
- public String getArtifactZip() {
- return artifactZip;
+ private String type;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getFilename() {
+ return filename;
}
public String getComponent() {
@@ -53,8 +63,8 @@
return version;
}
- public void setArtifactZip(String artifactZip) {
- this.artifactZip = artifactZip;
+ public void setFilename(String artifactZip) {
+ this.filename = artifactZip;
}
public void setComponent(String component) {
Modified: incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateComponentDescriptorMojo.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateComponentDescriptorMojo.java?rev=416068&r1=416067&r2=416068&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateComponentDescriptorMojo.java (original)
+++ incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateComponentDescriptorMojo.java Wed Jun 21 11:56:05 2006
@@ -23,16 +23,21 @@
import java.util.Set;
import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuildingException;
import org.codehaus.plexus.util.FileUtils;
/**
* A Mojo used to build the jbi.xml file.
- *
+ *
* @author <a href="gnodet@apache.org">Guillaume Nodet</a>
- * @version $Id: GenerateComponentDescriptorMojo 314956 2005-10-12 16:27:15Z brett $
+ * @version $Id: GenerateComponentDescriptorMojo 314956 2005-10-12 16:27:15Z
+ * brett $
* @goal generate-jbi-component-descriptor
* @phase generate-resources
* @requiresDependencyResolution runtime
@@ -40,142 +45,175 @@
*/
public class GenerateComponentDescriptorMojo extends AbstractJbiMojo {
- public static final String UTF_8 = "UTF-8";
-
- /**
- * Whether the application.xml should be generated or not.
- *
- * @parameter
- */
- private Boolean generateJbiDescriptor = Boolean.TRUE;
-
- /**
- * The component class name.
- *
- * @parameter
- * @required
- */
+ public static final String UTF_8 = "UTF-8";
+
+ /**
+ * Whether the application.xml should be generated or not.
+ *
+ * @parameter
+ */
+ private Boolean generateJbiDescriptor = Boolean.TRUE;
+
+ /**
+ * The component class name.
+ *
+ * @parameter
+ * @required
+ */
private String component;
-
- /**
- * The bootstrap class name.
- *
- * @parameter
- * @required
- */
+
+ /**
+ * The bootstrap class name.
+ *
+ * @parameter
+ * @required
+ */
private String bootstrap;
-
- /**
- * The component type.
- *
- * @parameter
- * @required
- */
+
+ /**
+ * The component type.
+ *
+ * @parameter
+ * @required
+ */
private String type;
-
- /**
- * The component name.
- *
- * @parameter expression="${project.artifactId}"
- */
+
+ /**
+ * The component name.
+ *
+ * @parameter expression="${project.artifactId}"
+ */
private String name;
-
- /**
- * The component description.
- *
- * @parameter expression="${project.name}"
- */
+
+ /**
+ * The component description.
+ *
+ * @parameter expression="${project.name}"
+ */
private String description;
-
- /**
- * Character encoding for the auto-generated application.xml file.
- *
- * @parameter
- */
- private String encoding = UTF_8;
-
- /**
- * Directory where the application.xml file will be auto-generated.
- *
- * @parameter expression="${project.build.directory}"
- */
- private String generatedDescriptorLocation;
-
+
+ /**
+ * Character encoding for the auto-generated application.xml file.
+ *
+ * @parameter
+ */
+ private String encoding = UTF_8;
+
+ /**
+ * Directory where the application.xml file will be auto-generated.
+ *
+ * @parameter expression="${project.build.directory}"
+ */
+ private String generatedDescriptorLocation;
+
+ /**
+ * @component
+ */
+ private MavenProjectBuilder pb;
+
+ /**
+ * @parameter default-value="${localRepository}"
+ */
+ private ArtifactRepository localRepo;
+
+ /**
+ * @parameter default-value="${project.remoteArtifactRepositories}"
+ */
+ private List remoteRepos;
+
public void execute() throws MojoExecutionException, MojoFailureException {
-
- getLog().debug( " ======= GenerateComponentDescriptorMojo settings =======" );
- getLog().debug( "workDirectory[" + workDirectory + "]" );
- getLog().debug( "generateJbiDescriptor[" + generateJbiDescriptor + "]" );
- getLog().debug( "type[" + type + "]" );
- getLog().debug( "component[" + component + "]" );
- getLog().debug( "bootstrap[" + bootstrap + "]" );
- getLog().debug( "name[" + name + "]" );
- getLog().debug( "description[" + description + "]" );
- getLog().debug( "encoding[" + encoding + "]" );
- getLog().debug( "generatedDescriptorLocation[" + generatedDescriptorLocation + "]" );
-
- if ( !generateJbiDescriptor.booleanValue() )
- {
- getLog().debug( "Generation of jbi.xml is disabled" );
- return;
- }
-
- // Generate jbi descriptor and copy it to the build directory
- getLog().info( "Generating jbi.xml" );
- try
- {
- generateJbiDescriptor();
- }
- catch ( JbiPluginException e )
- {
- throw new MojoExecutionException( "Failed to generate jbi.xml", e );
- }
-
- try
- {
- FileUtils.copyFileToDirectory( new File( generatedDescriptorLocation, JBI_DESCRIPTOR ),
- new File( getWorkDirectory(), META_INF ) );
- }
- catch ( IOException e )
- {
- throw new MojoExecutionException( "Unable to copy jbi.xml to final destination", e );
- }
+
+ getLog().debug(
+ " ======= GenerateComponentDescriptorMojo settings =======");
+ getLog().debug("workDirectory[" + workDirectory + "]");
+ getLog().debug("generateJbiDescriptor[" + generateJbiDescriptor + "]");
+ getLog().debug("type[" + type + "]");
+ getLog().debug("component[" + component + "]");
+ getLog().debug("bootstrap[" + bootstrap + "]");
+ getLog().debug("name[" + name + "]");
+ getLog().debug("description[" + description + "]");
+ getLog().debug("encoding[" + encoding + "]");
+ getLog().debug(
+ "generatedDescriptorLocation[" + generatedDescriptorLocation
+ + "]");
+
+ if (!generateJbiDescriptor.booleanValue()) {
+ getLog().debug("Generation of jbi.xml is disabled");
+ return;
+ }
+
+ // Generate jbi descriptor and copy it to the build directory
+ getLog().info("Generating jbi.xml");
+ try {
+ generateJbiDescriptor();
+ } catch (JbiPluginException e) {
+ throw new MojoExecutionException("Failed to generate jbi.xml", e);
+ }
+
+ try {
+ FileUtils.copyFileToDirectory(new File(generatedDescriptorLocation,
+ JBI_DESCRIPTOR), new File(getWorkDirectory(), META_INF));
+ } catch (IOException e) {
+ throw new MojoExecutionException(
+ "Unable to copy jbi.xml to final destination", e);
+ }
}
- /**
- * Generates the deployment descriptor if necessary.
- */
- protected void generateJbiDescriptor() throws JbiPluginException
- {
- File outputDir = new File( generatedDescriptorLocation );
- if ( !outputDir.exists() )
- {
- outputDir.mkdirs();
- }
-
- File descriptor = new File( outputDir, JBI_DESCRIPTOR );
-
- List uris = new ArrayList();
- uris.add(LIB_DIRECTORY + "/" + project.getArtifactId() + "-" + project.getVersion() + ".jar");
-
- Set artifacts = project.getArtifacts();
- for ( Iterator iter = artifacts.iterator(); iter.hasNext(); )
- {
- Artifact artifact = (Artifact) iter.next();
-
- // TODO: utilise appropriate methods from project builder
- ScopeArtifactFilter filter = new ScopeArtifactFilter( Artifact.SCOPE_RUNTIME );
- if ( !artifact.isOptional() && filter.include( artifact ) )
- {
- String type = artifact.getType();
- if ( "jar".equals( type ) )
- {
- uris.add(LIB_DIRECTORY + "/" + artifact.getFile().getName());
- }
- }
- }
-
- JbiComponentDescriptorWriter writer = new JbiComponentDescriptorWriter( encoding );
- writer.write(descriptor, component, bootstrap, type, name, description, uris);
- }
+ /**
+ * Generates the deployment descriptor if necessary.
+ */
+ protected void generateJbiDescriptor() throws JbiPluginException {
+ File outputDir = new File(generatedDescriptorLocation);
+ if (!outputDir.exists()) {
+ outputDir.mkdirs();
+ }
+
+ File descriptor = new File(outputDir, JBI_DESCRIPTOR);
+
+ List uris = new ArrayList();
+ DependencyInformation info = new DependencyInformation();
+ info.setFilename(LIB_DIRECTORY + "/" + project.getArtifactId() + "-"
+ + project.getVersion() + ".jar");
+ info.setVersion(project.getVersion());
+ info.setName(project.getArtifactId());
+ info.setType("jar");
+ uris.add(info);
+
+ Set artifacts = project.getArtifacts();
+ for (Iterator iter = artifacts.iterator(); iter.hasNext();) {
+ Artifact artifact = (Artifact) iter.next();
+
+ // TODO: utilise appropriate methods from project builder
+ ScopeArtifactFilter filter = new ScopeArtifactFilter(
+ Artifact.SCOPE_RUNTIME);
+ if (!artifact.isOptional() && filter.include(artifact)) {
+ MavenProject project = null;
+ try {
+ project = pb.buildFromRepository(artifact, remoteRepos,
+ localRepo);
+ } catch (ProjectBuildingException e) {
+ getLog().warn(
+ "Unable to determine packaging for dependency : "
+ + artifact.getArtifactId()
+ + " assuming jar");
+ }
+ info = new DependencyInformation();
+ info.setFilename(LIB_DIRECTORY + "/"
+ + artifact.getFile().getName());
+ info.setVersion(artifact.getVersion());
+ info.setName(artifact.getArtifactId());
+ if (project != null)
+ info.setType(project.getPackaging());
+ else
+ info.setType("jar");
+ uris.add(info);
+
+ }
+ }
+
+ JbiComponentDescriptorWriter writer = new JbiComponentDescriptorWriter(
+ encoding);
+ writer.write(descriptor, component, bootstrap, type, name, description,
+ uris);
+ }
}
Modified: incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java?rev=416068&r1=416067&r2=416068&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java (original)
+++ incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java Wed Jun 21 11:56:05 2006
@@ -154,22 +154,27 @@
ScopeArtifactFilter filter = new ScopeArtifactFilter(
Artifact.SCOPE_RUNTIME);
if (!artifact.isOptional() && filter.include(artifact)) {
- String type = artifact.getType();
- if ("jbi-service-unit".equals(type)) {
- try {
- MavenProject project = pb.buildFromRepository(artifact,
- remoteRepos, localRepo);
- DependencyInformation info = new DependencyInformation();
- info.setName(artifact.getArtifactId());
- info.setArtifactZip(artifact.getFile().getName());
- info.setComponent(project.getProperties().getProperty("jbiComponentName"));
- info.setDescription(project.getDescription());
- serviceUnits.add(info);
- } catch (ProjectBuildingException e) {
- throw new JbiPluginException(
- "Unable to resolve dependency : " + artifact, e);
- }
+ MavenProject project = null;
+ try {
+ project = pb.buildFromRepository(artifact, remoteRepos,
+ localRepo);
+ } catch (ProjectBuildingException e) {
+ getLog().warn(
+ "Unable to determine packaging for dependency : "
+ + artifact.getArtifactId()
+ + " assuming jar");
}
+ if (project != null
+ && project.getPackaging().equals("jbi-service-unit")) {
+ DependencyInformation info = new DependencyInformation();
+ info.setName(artifact.getArtifactId());
+ info.setFilename(artifact.getFile().getName());
+ info.setComponent(project.getProperties().getProperty(
+ "jbiComponentName"));
+ info.setDescription(project.getDescription());
+ serviceUnits.add(info);
+ }
+
}
}
Modified: incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateSharedLibraryDescriptorMojo.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateSharedLibraryDescriptorMojo.java?rev=416068&r1=416067&r2=416068&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateSharedLibraryDescriptorMojo.java (original)
+++ incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateSharedLibraryDescriptorMojo.java Wed Jun 21 11:56:05 2006
@@ -156,7 +156,15 @@
File descriptor = new File(outputDir, JBI_DESCRIPTOR);
- List serviceUnits = new ArrayList();
+ List embeddedLibraries = new ArrayList();
+
+ DependencyInformation info = new DependencyInformation();
+ info.setFilename(LIB_DIRECTORY + "/" + project.getArtifactId() + "-"
+ + project.getVersion() + ".jar");
+ info.setVersion(project.getVersion());
+ info.setName(project.getArtifactId());
+ info.setType("jar");
+ embeddedLibraries.add(info);
Set artifacts = project.getArtifacts();
for (Iterator iter = artifacts.iterator(); iter.hasNext();) {
@@ -168,7 +176,9 @@
if (!artifact.isOptional() && filter.include(artifact)) {
String type = artifact.getType();
if ("jar".equals(type)) {
- serviceUnits.add(artifact);
+ info = new DependencyInformation();
+ info.setFilename(artifact.getFile().getName());
+ embeddedLibraries.add(info);
}
}
}
@@ -176,6 +186,6 @@
JbiSharedLibraryDescriptorWriter writer = new JbiSharedLibraryDescriptorWriter(
encoding);
writer.write(descriptor, name, description, version,
- classLoaderDelegate, serviceUnits);
+ classLoaderDelegate, embeddedLibraries);
}
}
Modified: incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateSharedLibraryMojo.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateSharedLibraryMojo.java?rev=416068&r1=416067&r2=416068&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateSharedLibraryMojo.java (original)
+++ incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateSharedLibraryMojo.java Wed Jun 21 11:56:05 2006
@@ -57,7 +57,7 @@
* @parameter expression="${project.artifactId}-${project.version}.zip"
* @required
*/
- private String installerName;
+ private String sharedLibraryName;
/**
* The Zip archiver.
@@ -86,18 +86,18 @@
getLog().debug(" ======= GenerateInstallerMojo settings =======");
getLog().debug("workDirectory[" + workDirectory + "]");
- getLog().debug("installerName[" + installerName + "]");
+ getLog().debug("installerName[" + sharedLibraryName + "]");
getLog().debug("jbiSourceDirectory[" + jbiSourceDirectory + "]");
try {
- createUnpackedInstaller();
+ createUnpackedSharedLibrary();
- File installerFile = new File(outputDirectory, installerName);
+ File installerFile = new File(outputDirectory, sharedLibraryName);
createArchive(installerFile);
projectHelper.attachArtifact(project, "zip", "", new File(
- outputDirectory, installerName));
+ outputDirectory, sharedLibraryName));
} catch (JbiPluginException e) {
throw new MojoExecutionException("Failed to create shared library",
@@ -129,7 +129,7 @@
}
}
- private void createUnpackedInstaller() throws JbiPluginException {
+ private void createUnpackedSharedLibrary() throws JbiPluginException {
if (!workDirectory.isDirectory()) {
if (!workDirectory.mkdirs()) {
@@ -144,11 +144,12 @@
try {
FileUtils.copyFileToDirectory(projectArtifact, new File(
workDirectory, LIB_DIRECTORY));
+
} catch (IOException e) {
throw new JbiPluginException("Unable to copy file "
+ projectArtifact, e);
}
-
+
Set artifacts = project.getArtifacts();
for (Iterator iter = artifacts.iterator(); iter.hasNext();) {
Artifact artifact = (Artifact) iter.next();
Modified: incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiComponentDescriptorWriter.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiComponentDescriptorWriter.java?rev=416068&r1=416067&r2=416068&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiComponentDescriptorWriter.java (original)
+++ incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiComponentDescriptorWriter.java Wed Jun 21 11:56:05 2006
@@ -33,13 +33,8 @@
this.encoding = encoding;
}
- public void write(File descriptor,
- String component,
- String bootstrap,
- String type,
- String name,
- String description,
- List uris)
+ public void write(File descriptor, String component, String bootstrap,
+ String type, String name, String description, List uris)
throws JbiPluginException {
FileWriter w;
try {
@@ -56,7 +51,7 @@
writer.startElement("component");
writer.addAttribute("type", type);
-
+
writer.startElement("identification");
writer.startElement("name");
writer.writeText(name);
@@ -65,15 +60,18 @@
writer.writeText(description);
writer.endElement();
writer.endElement();
-
+
writer.startElement("component-class-name");
writer.writeText(component);
writer.endElement();
writer.startElement("component-class-path");
for (Iterator it = uris.iterator(); it.hasNext();) {
- writer.startElement("path-element");
- writer.writeText(it.next().toString());
- writer.endElement();
+ DependencyInformation info = (DependencyInformation) it.next();
+ if ("jar".equals(info.getType())) {
+ writer.startElement("path-element");
+ writer.writeText(info.getFilename());
+ writer.endElement();
+ }
}
writer.endElement();
@@ -82,19 +80,34 @@
writer.endElement();
writer.startElement("bootstrap-class-path");
for (Iterator it = uris.iterator(); it.hasNext();) {
- writer.startElement("path-element");
- writer.writeText(it.next().toString());
- writer.endElement();
+ DependencyInformation info = (DependencyInformation) it.next();
+ if ("jar".equals(info.getType())) {
+ writer.startElement("path-element");
+ writer.writeText(info.getFilename());
+ writer.endElement();
+ }
}
writer.endElement();
-
+
+ writer.startElement("shared-library-list");
+ for (Iterator it = uris.iterator(); it.hasNext();) {
+ DependencyInformation info = (DependencyInformation) it.next();
+ if ("jbi-shared-library".equals(info.getType())) {
+ writer.startElement("shared-library");
+ writer.addAttribute("version", info.getVersion());
+ writer.writeText(info.getName());
+ writer.endElement();
+ }
+ }
writer.endElement();
-
+
+ writer.endElement();
+
writer.endElement();
close(w);
}
-
+
private void close(Writer closeable) {
if (closeable != null) {
try {
Modified: incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceAssemblyDescriptorWriter.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceAssemblyDescriptorWriter.java?rev=416068&r1=416067&r2=416068&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceAssemblyDescriptorWriter.java (original)
+++ incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceAssemblyDescriptorWriter.java Wed Jun 21 11:56:05 2006
@@ -90,7 +90,7 @@
writer.startElement("target");
writer.startElement("artifacts-zip");
- writer.writeText(serviceUnitInfo.getArtifactZip());
+ writer.writeText(serviceUnitInfo.getFilename());
writer.endElement();
writer.startElement("component-name");
Modified: incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiSharedLibraryDescriptorWriter.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiSharedLibraryDescriptorWriter.java?rev=416068&r1=416067&r2=416068&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiSharedLibraryDescriptorWriter.java (original)
+++ incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiSharedLibraryDescriptorWriter.java Wed Jun 21 11:56:05 2006
@@ -69,9 +69,9 @@
writer.startElement("shared-library-class-path");
for (Iterator it = uris.iterator(); it.hasNext();) {
- Artifact serviceUnitInfo = (Artifact) it.next();
+ DependencyInformation dependency = (DependencyInformation) it.next();
writer.startElement("path-element");
- writer.writeText(serviceUnitInfo.getFile().getName());
+ writer.writeText(dependency.getFilename());
writer.endElement();
}
writer.endElement();
Modified: incubator/servicemix/trunk/tooling/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/tooling/pom.xml?rev=416068&r1=416067&r2=416068&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/pom.xml (original)
+++ incubator/servicemix/trunk/tooling/pom.xml Wed Jun 21 11:56:05 2006
@@ -40,6 +40,7 @@
<module>servicemix-service-engine</module>
<module>servicemix-service-unit</module>
<module>servicemix-service-assembly</module>
+ <module>servicemix-shared-library</module>
<module>jbi-maven-plugin</module>
</modules>
</project>
Modified: incubator/servicemix/trunk/tooling/servicemix-service-unit/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/tooling/servicemix-service-unit/src/main/resources/archetype-resources/pom.xml?rev=416068&r1=416067&r2=416068&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-service-unit/src/main/resources/archetype-resources/pom.xml (original)
+++ incubator/servicemix/trunk/tooling/servicemix-service-unit/src/main/resources/archetype-resources/pom.xml Wed Jun 21 11:56:05 2006
@@ -37,6 +37,7 @@
<servicemixVersion>3.0-M2-incubating</servicemixVersion>
<servicemixJbiPluginVersion>1.0-M2-incubating</servicemixJbiPluginVersion>
<xbeanPluginVersion>2.4</xbeanPluginVersion>
+ <jbiBindingComponent>myBindingComponent</jbiBindingComponent>
</properties>
<dependencies>
<dependency>
Propchange: incubator/servicemix/trunk/tooling/servicemix-shared-library/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Jun 21 11:56:05 2006
@@ -0,0 +1 @@
+target
Added: incubator/servicemix/trunk/tooling/servicemix-shared-library/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/tooling/servicemix-shared-library/pom.xml?rev=416068&view=auto
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-shared-library/pom.xml (added)
+++ incubator/servicemix/trunk/tooling/servicemix-shared-library/pom.xml Wed Jun 21 11:56:05 2006
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Rev: 365333 $ $Date: 2006-01-02 12:21:09 +0100 (lun., 02 janv. 2006) $ -->
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://maven.apache.org/POM/4.0.0">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix.tooling</groupId>
+ <artifactId>tooling</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>servicemix-shared-library</artifactId>
+ <name>ServiceMix :: Maven2 :: Archetypes :: SharedLibrary</name>
+
+</project>
\ No newline at end of file
Added: incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/META-INF/maven/archetype.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/META-INF/maven/archetype.xml?rev=416068&view=auto
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/META-INF/maven/archetype.xml (added)
+++ incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/META-INF/maven/archetype.xml Wed Jun 21 11:56:05 2006
@@ -0,0 +1,3 @@
+<archetype>
+ <id>servicemix-su</id>
+</archetype>
Added: incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/archetype-resources/pom.xml?rev=416068&view=auto
==============================================================================
--- incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/archetype-resources/pom.xml (added)
+++ incubator/servicemix/trunk/tooling/servicemix-shared-library/src/main/resources/archetype-resources/pom.xml Wed Jun 21 11:56:05 2006
@@ -0,0 +1,66 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <packaging>jbi-shared-library</packaging>
+ <version>${version}</version>
+ <name>A custom project</name>
+ <url>http://www.myorganization.org</url>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>apache.snapshots</id>
+ <name>Maven Central Plugins Development Repository</name>
+ <url>http://cvs.apache.org/maven-snapshot-repository</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </pluginRepository>
+ </pluginRepositories>
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <name>Maven Central Plugins Development Repository</name>
+ <url>http://cvs.apache.org/maven-snapshot-repository</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+ <properties>
+ <servicemixVersion>3.0-incubating</servicemixVersion>
+ <servicemixJbiPluginVersion>1.0-incubating</servicemixJbiPluginVersion>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.servicemix.tooling</groupId>
+ <artifactId>jbi-maven-plugin</artifactId>
+ <version>${servicemixJbiPluginVersion}</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+</project>