You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ks...@apache.org on 2015/10/29 21:35:13 UTC
[08/13] servicemix-maven-plugins git commit: Deprecated plugins
removed
http://git-wip-us.apache.org/repos/asf/servicemix-maven-plugins/blob/681882ee/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/IsDeployedTask.java
----------------------------------------------------------------------
diff --git a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/IsDeployedTask.java b/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/IsDeployedTask.java
deleted file mode 100644
index 6fe0f54..0000000
--- a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/IsDeployedTask.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.servicemix.maven.plugin.jbi;
-
-import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
-import org.apache.servicemix.jbi.management.task.JbiTask;
-
-public class IsDeployedTask extends JbiTask {
-
- private static final String JBI_SHARED_LIBRARY = "jbi-shared-library";
-
- private static final String JBI_COMPONENT = "jbi-component";
-
- private static final String JBI_SERVICE_ASSEMBLY = "jbi-service-assembly";
-
- private boolean deployed;
-
- private String type;
-
- private String name;
-
- public boolean isDeployed() {
- return deployed;
- }
-
- public void setDeployed(boolean deployed) {
- this.deployed = deployed;
- }
-
- protected void doExecute(AdminCommandsServiceMBean acs) throws Exception {
- if (JBI_SHARED_LIBRARY.equals(type)) {
- String result = acs.listSharedLibraries(null, name);
- setDeployed(isResultContaining(result, "shared-library", name));
- } else if (JBI_SERVICE_ASSEMBLY.equals(type)) {
- String result = acs.listServiceAssemblies(null, null, name);
- setDeployed(result.contains("<service-assembly-info name='" + name
- + "'"));
- }
- if (JBI_COMPONENT.equals(type)) {
- String result = acs.listComponents(false, false, false, null, null,
- null);
- if (isResultContaining(result, "service-engine", name)
- || isResultContaining(result, "binding-component", name)) {
- setDeployed(true);
- }
- }
- }
-
- private boolean isResultContaining(String result, String t, String n) {
- String componentLine = "<component-info type='" + t + "' name='" + n + "'";
- return result.contains(componentLine);
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/servicemix-maven-plugins/blob/681882ee/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiComponentDescriptorWriter.java
----------------------------------------------------------------------
diff --git a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiComponentDescriptorWriter.java b/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiComponentDescriptorWriter.java
deleted file mode 100644
index 6bfb56c..0000000
--- a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiComponentDescriptorWriter.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.servicemix.maven.plugin.jbi;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Writer;
-import java.util.Iterator;
-import java.util.List;
-
-import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
-import org.codehaus.plexus.util.xml.XMLWriter;
-
-public class JbiComponentDescriptorWriter {
-
- private final String encoding;
-
- public JbiComponentDescriptorWriter(String encoding) {
- this.encoding = encoding;
- }
-
- public void write(File descriptor,
- String component,
- String bootstrap,
- String type,
- String name,
- String description,
- String componentClassLoaderDelegation,
- String bootstrapClassLoaderDelegation,
- List uris) throws JbiPluginException {
- PrintWriter w;
- try {
- w = new PrintWriter(descriptor, encoding);
- } catch (IOException ex) {
- throw new JbiPluginException("Exception while opening file["
- + descriptor.getAbsolutePath() + "]", ex);
- }
-
- XMLWriter writer = new PrettyPrintXMLWriter(w, encoding, null);
- writer.startElement("jbi");
- writer.addAttribute("xmlns", "http://java.sun.com/xml/ns/jbi");
- writer.addAttribute("version", "1.0");
-
- writer.startElement("component");
- writer.addAttribute("type", type);
- writer.addAttribute("component-class-loader-delegation",
- componentClassLoaderDelegation);
- writer.addAttribute("bootstrap-class-loader-delegation",
- bootstrapClassLoaderDelegation);
-
- writer.startElement("identification");
- writer.startElement("name");
- writer.writeText(name);
- writer.endElement();
- writer.startElement("description");
- 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();) {
- DependencyInformation info = (DependencyInformation) it.next();
- if (!info.isSharedLibrary()) {
- writer.startElement("path-element");
- writer.writeText(info.getFilename());
- writer.endElement();
- }
- }
- writer.endElement();
-
- writer.startElement("bootstrap-class-name");
- writer.writeText(bootstrap);
- writer.endElement();
- writer.startElement("bootstrap-class-path");
- for (Iterator it = uris.iterator(); it.hasNext();) {
- DependencyInformation info = (DependencyInformation) it.next();
- if ("jar".equals(info.getType())) {
- writer.startElement("path-element");
- writer.writeText(info.getFilename());
- writer.endElement();
- }
- }
- writer.endElement();
-
- for (Iterator it = uris.iterator(); it.hasNext();) {
- DependencyInformation info = (DependencyInformation) it.next();
- if (info.isSharedLibrary()) {
- writer.startElement("shared-library");
- writer.addAttribute("version", info.getVersion());
- writer.writeText(info.getName());
- writer.endElement();
- }
- }
-
- writer.endElement();
-
- writer.endElement();
-
- close(w);
- }
-
- private void close(Writer closeable) {
- if (closeable != null) {
- try {
- closeable.close();
- } catch (Exception e) {
- // TODO: warn
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/servicemix-maven-plugins/blob/681882ee/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiPluginException.java
----------------------------------------------------------------------
diff --git a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiPluginException.java b/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiPluginException.java
deleted file mode 100644
index 78e3ef3..0000000
--- a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiPluginException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.servicemix.maven.plugin.jbi;
-
-public class JbiPluginException extends Exception {
-
- public JbiPluginException() {
- super();
- }
-
- public JbiPluginException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public JbiPluginException(String message) {
- super(message);
- }
-
- public JbiPluginException(Throwable cause) {
- super(cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/servicemix-maven-plugins/blob/681882ee/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiProjectDeployerMojo.java
----------------------------------------------------------------------
diff --git a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiProjectDeployerMojo.java b/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiProjectDeployerMojo.java
deleted file mode 100644
index d868abe..0000000
--- a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiProjectDeployerMojo.java
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.servicemix.maven.plugin.jbi;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Stack;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.ProjectBuildingException;
-import org.apache.servicemix.jbi.management.task.DeployServiceAssemblyTask;
-import org.apache.servicemix.jbi.management.task.InstallComponentTask;
-import org.apache.servicemix.jbi.management.task.InstallSharedLibraryTask;
-import org.apache.servicemix.jbi.management.task.ShutDownComponentTask;
-import org.apache.servicemix.jbi.management.task.ShutDownServiceAssemblyTask;
-import org.apache.servicemix.jbi.management.task.StartComponentTask;
-import org.apache.servicemix.jbi.management.task.StartServiceAssemblyTask;
-import org.apache.servicemix.jbi.management.task.StopComponentTask;
-import org.apache.servicemix.jbi.management.task.StopServiceAssemblyTask;
-import org.apache.servicemix.jbi.management.task.UndeployServiceAssemblyTask;
-import org.apache.servicemix.jbi.management.task.UninstallComponentTask;
-import org.apache.servicemix.jbi.management.task.UninstallSharedLibraryTask;
-
-/**
- * A Mojo that can take any project and determine its JBI dependencies and then
- * install it and its dependencies using the JBI deployment tasks
- *
- * @author <a href="pdodds@apache.org">Philip Dodds</a>
- * @version $Id: GenerateComponentDescriptorMojo 314956 2005-10-12 16:27:15Z
- * brett $
- * @goal projectDeploy
- * @requiresDependencyResolution runtime
- * @description Starts a ServiceMix instance and installs the project (and all
- * dependencies) to it
- */
-public class JbiProjectDeployerMojo extends AbstractDeployableMojo {
-
- public static final String JBI_SHARED_LIBRARY = "jbi-shared-library";
-
- public static final String JBI_COMPONENT = "jbi-component";
-
- public static final String JBI_SERVICE_ASSEMBLY = "jbi-service-assembly";
-
- private List deploymentTypes;
-
- /**
- * @parameter default-value="true" expression="${deployDependencies}"
- */
- private boolean deployDependencies;
-
- /**
- * @parameter default-value="false" expression="${forceUpdate}"
- */
- private boolean forceUpdate;
-
- /**
- * @parameter default-value="true" expression="${deferExceptions}"
- */
- private boolean deferExceptions;
-
- /**
- * @parameter default-value="true" expression="${deployChildren}"
- */
- private boolean deployChildren;
-
- public void execute() throws MojoExecutionException, MojoFailureException {
- deployProject();
- }
-
- protected void deployProject() throws MojoExecutionException {
- if (!deployChildren
- && !getDeployablePackagingTypes().contains(
- project.getPackaging())) {
- throw new MojoExecutionException(
- "Project must be of packaging type ["
- + getDeployablePackagingTypes() + "]");
- }
-
- try {
- Stack dependencies = new Stack();
- if (deployChildren) {
- resolveArtifact(project.getArtifact(), dependencies);
- } else {
- dependencies.add(resolveDeploymentPackage(project, project
- .getArtifact()));
- List artifactList = new ArrayList();
- artifactList.addAll(project.getArtifacts());
- Collections.sort(artifactList, new ArtifactDepthComparator());
- for (Iterator iter = artifactList.iterator(); iter.hasNext();) {
- Artifact artifact = (Artifact) iter.next();
- resolveArtifact(artifact, dependencies);
- }
- }
-
- getLog()
- .info(
- "------------------ Deployment Analysis --------------------");
- getLog().info(
- project.getName() + " has " + (dependencies.size() - 1)
- + " child dependencies");
-
- for (Iterator iterator = dependencies.iterator(); iterator
- .hasNext();) {
- getLog().info(" - " + iterator.next());
- }
-
- getLog()
- .info(
- "-----------------------------------------------------------");
-
- if (deployDependencies) {
- // We need to stop all the dependencies first
- if (!deferExceptions) {
- for (Iterator iterator = dependencies.iterator(); iterator
- .hasNext();) {
- JbiDeployableArtifact jbiDeployable = (JbiDeployableArtifact) iterator
- .next();
-
- if (forceUpdate && isDeployed(jbiDeployable)) {
- stopDependency(jbiDeployable);
- undeployDependency(jbiDeployable);
- }
- }
- }
-
- // Now we can walk the dependencies bottom up - re-deploying and
- // starting them
- while (!dependencies.empty()) {
- JbiDeployableArtifact jbiDeployable = (JbiDeployableArtifact) dependencies
- .pop();
- if (forceUpdate || !isDeployed(jbiDeployable)) {
- deployDependency(jbiDeployable, deferExceptions);
- if (!deferExceptions) {
- startDependency(jbiDeployable);
- }
- }
- }
- } else {
- JbiDeployableArtifact jbiDeployable = (JbiDeployableArtifact) dependencies
- .firstElement();
- if (isDeployed(jbiDeployable)) {
- stopDependency(jbiDeployable);
- undeployDependency(jbiDeployable);
- }
- deployDependency(jbiDeployable, deferExceptions);
- startDependency(jbiDeployable);
- }
-
- } catch (Exception e) {
- throw new MojoExecutionException("Unable to deploy project, "
- + e.getMessage(), e);
- }
-
- }
-
- protected void startDependency(JbiDeployableArtifact jbiDeployable) {
- getLog().info("Starting " + jbiDeployable.getName());
- if (JBI_SERVICE_ASSEMBLY.equals(jbiDeployable.getType())) {
- StartServiceAssemblyTask startTask = new StartServiceAssemblyTask();
- initializeJbiTask(startTask);
- startTask.setName(jbiDeployable.getName());
- startTask.execute();
- }
- if (JBI_COMPONENT.equals(jbiDeployable.getType())) {
- StartComponentTask startTask = new StartComponentTask();
- initializeJbiTask(startTask);
- startTask.setName(jbiDeployable.getName());
- startTask.execute();
- }
- }
-
- protected void undeployDependency(JbiDeployableArtifact jbiDeployable) {
- getLog().info("Undeploying " + jbiDeployable.getFile());
- if (JBI_SHARED_LIBRARY.equals(jbiDeployable.getType())) {
- UninstallSharedLibraryTask sharedLibraryTask = new UninstallSharedLibraryTask();
- initializeJbiTask(sharedLibraryTask);
- sharedLibraryTask.setName(jbiDeployable.getName());
- sharedLibraryTask.execute();
- } else if (JBI_SERVICE_ASSEMBLY.equals(jbiDeployable.getType())) {
- UndeployServiceAssemblyTask serviceAssemblyTask = new UndeployServiceAssemblyTask();
- initializeJbiTask(serviceAssemblyTask);
- serviceAssemblyTask.setName(jbiDeployable.getName());
- serviceAssemblyTask.execute();
- }
- if (JBI_COMPONENT.equals(jbiDeployable.getType())) {
- UninstallComponentTask componentTask = new UninstallComponentTask();
- initializeJbiTask(componentTask);
- componentTask.setName(jbiDeployable.getName());
- componentTask.execute();
- }
- }
-
- protected boolean isDeployed(JbiDeployableArtifact jbiDeployable) {
- IsDeployedTask isDeployedTask = new IsDeployedTask();
- isDeployedTask.setType(jbiDeployable.getType());
- isDeployedTask.setName(jbiDeployable.getName());
- initializeJbiTask(isDeployedTask);
- isDeployedTask.execute();
- boolean deployed = isDeployedTask.isDeployed();
- if (deployed) {
- getLog().info(jbiDeployable.getName() + " is deployed");
- } else {
- getLog().info(jbiDeployable.getName() + " is not deployed");
- }
- return deployed;
- }
-
- protected void stopDependency(JbiDeployableArtifact jbiDeployable) {
- getLog().info("Stopping " + jbiDeployable.getName());
- if (JBI_SERVICE_ASSEMBLY.equals(jbiDeployable.getType())) {
- StopServiceAssemblyTask stopTask = new StopServiceAssemblyTask();
- initializeJbiTask(stopTask);
- stopTask.setName(jbiDeployable.getName());
- stopTask.execute();
-
- ShutDownServiceAssemblyTask shutdownTask = new ShutDownServiceAssemblyTask();
- initializeJbiTask(shutdownTask);
- shutdownTask.setName(jbiDeployable.getName());
- shutdownTask.execute();
- }
- if (JBI_COMPONENT.equals(jbiDeployable.getType())) {
- StopComponentTask stopTask = new StopComponentTask();
- initializeJbiTask(stopTask);
- stopTask.setName(jbiDeployable.getName());
- stopTask.execute();
-
- ShutDownComponentTask shutdownTask = new ShutDownComponentTask();
- initializeJbiTask(shutdownTask);
- shutdownTask.setName(jbiDeployable.getName());
- shutdownTask.execute();
- }
- }
-
- protected void deployDependency(JbiDeployableArtifact jbiDeployable,
- boolean doDeferExceptions) throws MojoExecutionException {
-
- getLog().info(
- "Deploying " + jbiDeployable.getType() + " from "
- + jbiDeployable.getFile());
- if (JBI_SHARED_LIBRARY.equals(jbiDeployable.getType())) {
- InstallSharedLibraryTask componentTask = new InstallSharedLibraryTask();
- initializeJbiTask(componentTask);
- componentTask.setFile(jbiDeployable.getFile());
- componentTask.setDeferExceptions(doDeferExceptions);
- componentTask.execute();
- } else if (JBI_SERVICE_ASSEMBLY.equals(jbiDeployable.getType())) {
- DeployServiceAssemblyTask componentTask = new DeployServiceAssemblyTask();
- initializeJbiTask(componentTask);
- componentTask.setFile(jbiDeployable.getFile());
- componentTask.setDeferExceptions(doDeferExceptions);
- componentTask.execute();
- }
- if (JBI_COMPONENT.equals(jbiDeployable.getType())) {
- InstallComponentTask componentTask = new InstallComponentTask();
- initializeJbiTask(componentTask);
- componentTask.setFile(jbiDeployable.getFile());
- componentTask.setDeferExceptions(doDeferExceptions);
- componentTask.execute();
- }
-
- }
-
- protected List getDeployablePackagingTypes() {
- if (deploymentTypes == null) {
- deploymentTypes = new ArrayList();
- deploymentTypes.add(JBI_SHARED_LIBRARY);
- deploymentTypes.add(JBI_SERVICE_ASSEMBLY);
- deploymentTypes.add(JBI_COMPONENT);
- }
- return deploymentTypes;
- }
-
- private Collection resolveArtifact(Artifact artifact,
- Stack dependencies) throws ArtifactResolutionException, ArtifactNotFoundException {
- MavenProject project = null;
- try {
- project = projectBuilder.buildFromRepository(artifact, remoteRepos,
- localRepo, false);
- } catch (ProjectBuildingException e) {
- getLog().warn(
- "Unable to determine packaging for dependency : "
- + artifact.getArtifactId() + " assuming jar");
- }
-
- if (project != null) {
- if (getDeployablePackagingTypes().contains(project.getPackaging())) {
- getLog().debug(
- "Checking for dependency from project "
- + project.getArtifactId());
- JbiDeployableArtifact deployableArtifact = resolveDeploymentPackage(
- project, artifact);
- if (!dependencies.contains(deployableArtifact)) {
- getLog().debug(
- "Adding dependency from project "
- + project.getArtifactId());
- dependencies.push(deployableArtifact);
- }
- List artifactList = new ArrayList();
- artifactList.addAll(project.getArtifacts());
- Collections.sort(artifactList, new ArtifactDepthComparator());
- for (Iterator iter = artifactList.iterator(); iter.hasNext();) {
- resolveArtifact((Artifact) iter.next(), dependencies);
- }
- } else {
- getLog().debug(
- "Ignoring non-jbi dependency: "
- + project.getArtifactId() + " of type "
- + project.getPackaging());
- }
- }
- return dependencies;
- }
-
- protected JbiDeployableArtifact resolveDeploymentPackage(
- MavenProject project,
- Artifact artifact) throws ArtifactResolutionException, ArtifactNotFoundException {
- Artifact jbiArtifact = factory.createArtifactWithClassifier(artifact
- .getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
- "zip", getExtension(project));
- resolver.resolve(jbiArtifact, remoteRepos, localRepo);
- return new JbiDeployableArtifact(project.getArtifactId(), project
- .getPackaging(), jbiArtifact.getFile().getAbsolutePath());
- }
-
- protected String getExtension(MavenProject project2) {
- if (project2.getPackaging().equals(JBI_SERVICE_ASSEMBLY)) {
- return "";
- } else {
- return "installer";
- }
- }
-
- protected class ArtifactDepthComparator implements Comparator {
-
- public int compare(Object arg0, Object arg1) {
- int size1 = ((Artifact) arg0).getDependencyTrail().size();
- int size2 = ((Artifact) arg1).getDependencyTrail().size();
- if (size1 == size2) {
- return 0;
- }
- if (size1 > size2) {
- return 1;
- } else {
- return -1;
- }
- }
-
- }
-
- protected class JbiDeployableArtifact {
- private String file;
-
- private String type;
-
- private String name;
-
- public JbiDeployableArtifact(String name, String type, String file) {
- this.name = name;
- this.file = file;
- this.type = type;
- }
-
- public String getName() {
- return name;
- }
-
- public String getFile() {
- return file;
- }
-
- public String getType() {
- return type;
- }
-
- public String toString() {
- return type + " : " + file;
- }
-
- public boolean equals(Object obj) {
- if (obj instanceof JbiDeployableArtifact) {
- return ((JbiDeployableArtifact) obj).toString().equals(this.toString());
- } else {
- return false;
- }
- }
-
- public int hashCode() {
- return toString().hashCode();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/servicemix-maven-plugins/blob/681882ee/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiResolutionListener.java
----------------------------------------------------------------------
diff --git a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiResolutionListener.java b/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiResolutionListener.java
deleted file mode 100644
index ad7b667..0000000
--- a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiResolutionListener.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.servicemix.maven.plugin.jbi;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.Stack;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.resolver.ResolutionListener;
-import org.apache.maven.artifact.versioning.VersionRange;
-import org.apache.maven.plugin.logging.Log;
-
-/**
- * @author Edwin Punzalan
- */
-public class JbiResolutionListener implements ResolutionListener {
- private Stack parents = new Stack();
-
- private Map artifacts = new HashMap();
-
- private Node rootNode;
-
- private Log log;
-
- public void setLog(Log log) {
- this.log = log;
- }
-
- public Log getLog() {
- return log;
- }
-
- public void testArtifact(Artifact artifact) {
- // getLog().debug("testArtifact: " + artifact);
- // intentionally blank
- }
-
- public void startProcessChildren(Artifact artifact) {
- // getLog().debug("startProcessChildren: " + artifact);
- Node node = (Node) artifacts.get(artifact.getDependencyConflictId());
- if (parents.isEmpty()) {
- rootNode = node;
- }
- parents.push(node);
- }
-
- public void endProcessChildren(Artifact artifact) {
- // getLog().debug("endProcessChildren: " + artifact);
- Node check = (Node) parents.pop();
- assert artifact.equals(check.artifact);
- }
-
- public void omitForNearer(Artifact omitted, Artifact kept) {
- // getLog().debug("omitForNearer: omitted=" + omitted + ", kept=" +
- // kept);
- assert omitted.getDependencyConflictId().equals(
- kept.getDependencyConflictId());
- Node node = (Node) artifacts.get(omitted.getDependencyConflictId());
- assert node != null;
- node.artifact = kept;
- }
-
- public void omitForCycle(Artifact artifact) {
- // getLog().debug("omitForCycle: " + artifact);
- // intentionally blank
- }
-
- public void includeArtifact(Artifact artifact) {
- // getLog().debug("includeArtifact: " + artifact);
- Node node = (Node) artifacts.get(artifact.getDependencyConflictId());
- if (node == null) {
- node = new Node();
- artifacts.put(artifact.getDependencyConflictId(), node);
- }
- node.artifact = artifact;
- if (!parents.isEmpty()) {
- Node parent = (Node) parents.peek();
- parent.children.add(node);
- node.parents.add(parent);
- }
- if (rootNode != null) {
- // print(rootNode, "");
- }
- }
-
- protected void print(Node node, String string) {
- // getLog().debug(string + rootNode.getArtifact());
- for (Iterator iter = node.getChildren().iterator(); iter.hasNext();) {
- Node n = (Node) iter.next();
- print(n, string + " ");
- }
- }
-
- public void updateScope(Artifact artifact, String scope) {
- getLog().debug("updateScope: " + artifact);
- Node node = (Node) artifacts.get(artifact.getDependencyConflictId());
-
- node.setScope(scope);
- }
-
- public void manageArtifact(Artifact artifact, Artifact replacement) {
- getLog().debug("manageArtifact: artifact=" + artifact + ", replacement=" + replacement);
- Node node = (Node) artifacts.get(artifact.getDependencyConflictId());
- if (node != null) {
- if (replacement.getVersion() != null) {
- node.artifact.setVersion(replacement.getVersion());
- }
- if (replacement.getScope() != null) {
- node.artifact.setScope(replacement.getScope());
- }
- }
- }
-
- public void updateScopeCurrentPom(Artifact artifact, String key) {
-
- getLog().debug("updateScopeCurrentPom: " + artifact);
- // intentionally blank
- }
-
- public void selectVersionFromRange(Artifact artifact) {
-
- getLog().debug("selectVersionFromRange: " + artifact);
- // intentionally blank
- }
-
- public void restrictRange(Artifact artifact, Artifact artifact1,
- VersionRange versionRange) {
-
- getLog().debug("restrictRange: " + artifact);
- // intentionally blank
- }
-
- public Node getNode(Artifact artifact) {
- return (Node) artifacts.get(artifact.getDependencyConflictId());
- }
-
- public Collection getArtifacts() {
- return artifacts.values();
- }
-
- static class Node {
- private Set<Node> children = new HashSet<Node>();
-
- private Set<Node> parents = new HashSet<Node>();
-
- private Artifact artifact;
-
- private String scope;
-
- public Set<Node> getChildren() {
- return children;
- }
-
- public Artifact getArtifact() {
- return artifact;
- }
-
- public Set<Node> getParents() {
- return parents;
- }
-
- public String getScope() {
- if (scope != null) {
- return scope;
- }
- return artifact.getScope();
- }
-
- public void setScope(String scope) {
- this.scope = scope;
- }
- }
-
- public Node getRootNode() {
- return rootNode;
- }
-}
http://git-wip-us.apache.org/repos/asf/servicemix-maven-plugins/blob/681882ee/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceAssemblyDescriptorWriter.java
----------------------------------------------------------------------
diff --git a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceAssemblyDescriptorWriter.java b/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceAssemblyDescriptorWriter.java
deleted file mode 100644
index be1b0c3..0000000
--- a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceAssemblyDescriptorWriter.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.servicemix.maven.plugin.jbi;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.servicemix.maven.plugin.jbi.GenerateServiceAssemblyDescriptorMojo.Connection;
-import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
-import org.codehaus.plexus.util.xml.XMLWriter;
-
-/**
- * Helper that can be used to write the jbi.xml for a service assembly
- *
- */
-public class JbiServiceAssemblyDescriptorWriter extends
- AbstractDescriptorWriter {
-
- private final String encoding;
-
- public JbiServiceAssemblyDescriptorWriter(String encoding) {
- this.encoding = encoding;
- }
-
- public void write(File descriptor, String name, String description,
- List uris, List connections) throws JbiPluginException {
- PrintWriter w;
- try {
- w = new PrintWriter(descriptor, encoding);
- } catch (IOException ex) {
- throw new JbiPluginException("Exception while opening file["
- + descriptor.getAbsolutePath() + "]", ex);
- }
-
- XMLWriter writer = new PrettyPrintXMLWriter(w, encoding, null);
- writer.startElement("jbi");
- writer.addAttribute("xmlns", "http://java.sun.com/xml/ns/jbi");
- writer.addAttribute("version", "1.0");
-
- writer.startElement("service-assembly");
-
- writer.startElement("identification");
- writer.startElement("name");
- writer.writeText(name);
- writer.endElement();
- writer.startElement("description");
- writer.writeText(description);
- writer.endElement();
- writer.endElement();
-
- for (Iterator it = uris.iterator(); it.hasNext();) {
- DependencyInformation serviceUnitInfo = (DependencyInformation) it
- .next();
- writeServiceUnit(writer, serviceUnitInfo);
-
- }
-
- if (!connections.isEmpty()) {
- writer.startElement("connections");
-
- Map namespaceMap = buildNamespaceMap(connections);
- for (Iterator it = connections.iterator(); it.hasNext();) {
- GenerateServiceAssemblyDescriptorMojo.Connection connection = (GenerateServiceAssemblyDescriptorMojo.Connection) it
- .next();
- writeConnection(namespaceMap, writer, connection);
-
- }
- writer.endElement();
- }
-
- writer.endElement();
- writer.endElement();
-
- close(w);
- }
-
- private Map buildNamespaceMap(List connections) {
- List consumes = new ArrayList();
- List provides = new ArrayList();
- for (Iterator it = connections.iterator(); it.hasNext();) {
- GenerateServiceAssemblyDescriptorMojo.Connection connection = (GenerateServiceAssemblyDescriptorMojo.Connection) it
- .next();
- consumes.add(connection.getConsumes());
- provides.add(connection.getProvides());
- }
-
- return getNamespaceMap(provides, consumes);
-
- }
-
- private void writeConnection(Map namespaceMap, XMLWriter writer,
- Connection connection) {
- writer.startElement("connection");
- if (connection.getConsumes() != null) {
- writer.startElement("consumer");
- addQNameAttribute(writer, "interface-name", connection
- .getConsumes().getInterfaceName(), namespaceMap);
- addQNameAttribute(writer, "service-name", connection.getConsumes()
- .getServiceName(), namespaceMap);
- addStringAttribute(writer, "endpoint-name", connection
- .getConsumes().getEndpointName());
- writer.endElement();
- }
- if (connection.getProvides() != null) {
- writer.startElement("provider");
- addQNameAttribute(writer, "interface-name", connection
- .getProvides().getInterfaceName(), namespaceMap);
- addQNameAttribute(writer, "service-name", connection.getProvides()
- .getServiceName(), namespaceMap);
- addStringAttribute(writer, "endpoint-name", connection
- .getProvides().getEndpointName());
- writer.endElement();
- }
-
- writer.endElement();
-
- }
-
- private void writeServiceUnit(XMLWriter writer,
- DependencyInformation serviceUnitInfo) throws JbiPluginException {
- writer.startElement("service-unit");
- writer.startElement("identification");
- writer.startElement("name");
- writer.writeText(serviceUnitInfo.getName());
- writer.endElement();
- writer.startElement("description");
- if (serviceUnitInfo.getDescription() != null) {
- writer.writeText(serviceUnitInfo.getDescription());
- } else {
- writer.writeText(serviceUnitInfo.getName());
- }
- writer.endElement();
- writer.endElement();
-
- writer.startElement("target");
- writer.startElement("artifacts-zip");
- writer.writeText(serviceUnitInfo.getFilename());
- writer.endElement();
-
- writer.startElement("component-name");
- writer.writeText(serviceUnitInfo.getComponent());
- writer.endElement();
-
- writer.endElement();
-
- writer.endElement();
- }
-
- private void close(Writer closeable) {
- if (closeable != null) {
- try {
- closeable.close();
- } catch (Exception e) {
- // TODO: warn
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/servicemix-maven-plugins/blob/681882ee/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceFileAnalyzer.java
----------------------------------------------------------------------
diff --git a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceFileAnalyzer.java b/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceFileAnalyzer.java
deleted file mode 100644
index d1987a6..0000000
--- a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceFileAnalyzer.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.servicemix.maven.plugin.jbi;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.servicemix.common.packaging.Consumes;
-import org.apache.servicemix.common.packaging.Provides;
-import org.apache.servicemix.common.packaging.ServiceUnitAnalyzer;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * A dummy implementation of the ServiceUnitAnalyzer that allows you to generate
- * the consumes and provides from a simple XML file
- *
- */
-public class JbiServiceFileAnalyzer implements ServiceUnitAnalyzer {
-
- public static final String JBI_NAMESPACE = "http://java.sun.com/xml/ns/jbi";
-
- private final List consumes = new ArrayList();
-
- private final List provides = new ArrayList();
-
- public List getConsumes() {
- return consumes;
- }
-
- public List getProvides() {
- return provides;
- }
-
- public void init(File explodedServiceUnitRoot) {
-
- }
-
- public void setJbiServicesFile(File jbiServicesFile) throws MojoExecutionException {
- parseXml(jbiServicesFile);
- }
-
- private void parseXml(File jbiServicesFile) throws MojoExecutionException {
- try {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- dbf.setNamespaceAware(true);
- DocumentBuilder db = dbf.newDocumentBuilder();
- Document doc = db.parse(jbiServicesFile);
-
- // Stop at first services child node that is found
- NodeList childNodes = doc.getChildNodes();
- Node servicesNode = null;
- for (int i = 0; i < childNodes.getLength(); i++) {
- if (XmlDescriptorHelper.isElement(childNodes.item(i), JBI_NAMESPACE,
- "services")) {
- servicesNode = childNodes.item(i);
- break;
- }
- }
- if (servicesNode != null) {
- // We will process the children
- Element servicesElement = (Element) servicesNode;
- NodeList children = servicesElement.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- if (children.item(i) instanceof Element) {
- Element childElement = (Element) children.item(i);
- if (XmlDescriptorHelper.isElement(childElement,
- JBI_NAMESPACE, "consumes")) {
- Consumes newConsumes = new Consumes();
- newConsumes.setEndpointName(XmlDescriptorHelper
- .getEndpointName(childElement));
- newConsumes.setInterfaceName(XmlDescriptorHelper
- .getInterfaceName(childElement));
- newConsumes.setServiceName(XmlDescriptorHelper
- .getServiceName(childElement));
- consumes.add(newConsumes);
- } else if (XmlDescriptorHelper.isElement(childElement,
- JBI_NAMESPACE, "provides")) {
- Provides newProvides = new Provides();
- newProvides.setEndpointName(XmlDescriptorHelper
- .getEndpointName(childElement));
- newProvides.setInterfaceName(XmlDescriptorHelper
- .getInterfaceName(childElement));
- newProvides.setServiceName(XmlDescriptorHelper
- .getServiceName(childElement));
- provides.add(newProvides);
- }
- }
- }
- }
-
- } catch (Exception e) {
- throw new MojoExecutionException("Unable to parse "
- + jbiServicesFile.getAbsolutePath());
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/servicemix-maven-plugins/blob/681882ee/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceUnitDescriptorWriter.java
----------------------------------------------------------------------
diff --git a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceUnitDescriptorWriter.java b/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceUnitDescriptorWriter.java
deleted file mode 100644
index 5f49fa6..0000000
--- a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiServiceUnitDescriptorWriter.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.servicemix.maven.plugin.jbi;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Writer;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.servicemix.common.packaging.Consumes;
-import org.apache.servicemix.common.packaging.Provides;
-import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
-import org.codehaus.plexus.util.xml.XMLWriter;
-
-/**
- * Helper that is used to write the jbi.xml for a service unit
- *
- */
-public class JbiServiceUnitDescriptorWriter extends AbstractDescriptorWriter {
-
- private final String encoding;
-
- public JbiServiceUnitDescriptorWriter(String encoding) {
- this.encoding = encoding;
- }
-
- public void write(File descriptor,
- boolean bc,
- String name,
- String description,
- List uris,
- List consumes,
- List provides) throws JbiPluginException {
- PrintWriter w;
- try {
- w = new PrintWriter(descriptor, encoding);
- } catch (IOException ex) {
- throw new JbiPluginException("Exception while opening file["
- + descriptor.getAbsolutePath() + "]", ex);
- }
-
- XMLWriter writer = new PrettyPrintXMLWriter(w, encoding, null);
- writer.startElement("jbi");
- writer.addAttribute("xmlns", "http://java.sun.com/xml/ns/jbi");
- writer.addAttribute("version", "1.0");
-
- writer.startElement("services");
- writer.addAttribute("binding-component", bc ? "true" : "false");
-
- // We need to get all the namespaces into a hashmap so we
- // can get the QName output correctly
- Map namespaceMap = getNamespaceMap(provides, consumes);
-
- // Set-up the namespaces
- for (Iterator iterator = namespaceMap.keySet().iterator(); iterator
- .hasNext();) {
- String key = (String) iterator.next();
- StringBuffer namespaceDecl = new StringBuffer();
- namespaceDecl.append("xmlns:");
- namespaceDecl.append(namespaceMap.get(key));
- writer.addAttribute(namespaceDecl.toString(), key);
- }
-
- // Put in the provides
- for (Iterator iterator = provides.iterator(); iterator.hasNext();) {
- Provides providesEntry = (Provides) iterator.next();
- writer.startElement("provides");
- addQNameAttribute(writer, "interface-name", providesEntry
- .getInterfaceName(), namespaceMap);
- addQNameAttribute(writer, "service-name", providesEntry
- .getServiceName(), namespaceMap);
- addStringAttribute(writer, "endpoint-name", providesEntry
- .getEndpointName());
- writer.endElement();
- }
-
- // Put in the consumes
- for (Iterator iterator = consumes.iterator(); iterator.hasNext();) {
- Consumes consumesEntry = (Consumes) iterator.next();
- writer.startElement("consumes");
- addQNameAttribute(writer, "interface-name", consumesEntry
- .getInterfaceName(), namespaceMap);
- addQNameAttribute(writer, "service-name", consumesEntry
- .getServiceName(), namespaceMap);
- addStringAttribute(writer, "endpoint-name", consumesEntry
- .getEndpointName());
-
- // TODO Handling of LinkType?
-
- writer.endElement();
- }
-
- writer.endElement();
-
- writer.endElement();
-
- close(w);
- }
-
- private void close(Writer closeable) {
- if (closeable != null) {
- try {
- closeable.close();
- } catch (Exception e) {
- // TODO: warn
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/servicemix-maven-plugins/blob/681882ee/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiSharedLibraryDescriptorWriter.java
----------------------------------------------------------------------
diff --git a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiSharedLibraryDescriptorWriter.java b/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiSharedLibraryDescriptorWriter.java
deleted file mode 100644
index 094f881..0000000
--- a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/JbiSharedLibraryDescriptorWriter.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.servicemix.maven.plugin.jbi;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Writer;
-import java.util.Iterator;
-import java.util.List;
-
-import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
-import org.codehaus.plexus.util.xml.XMLWriter;
-
-/**
- * Helper that is used to write the jbi.xml for a shared library
- *
- */
-public class JbiSharedLibraryDescriptorWriter {
-
- private final String encoding;
-
- public JbiSharedLibraryDescriptorWriter(String encoding) {
- this.encoding = encoding;
- }
-
- public void write(File descriptor,
- String name,
- String description,
- String version,
- String classLoaderDelegation,
- List uris) throws JbiPluginException {
- PrintWriter w;
- try {
- w = new PrintWriter(descriptor, encoding);
- } catch (IOException ex) {
- throw new JbiPluginException("Exception while opening file["
- + descriptor.getAbsolutePath() + "]", ex);
- }
-
- XMLWriter writer = new PrettyPrintXMLWriter(w, encoding, null);
- writer.startElement("jbi");
- writer.addAttribute("xmlns", "http://java.sun.com/xml/ns/jbi");
- writer.addAttribute("version", "1.0");
-
- writer.startElement("shared-library");
- writer.addAttribute("class-loader-delegation", classLoaderDelegation);
- writer.addAttribute("version", version);
-
- writer.startElement("identification");
- writer.startElement("name");
- writer.writeText(name);
- writer.endElement();
- writer.startElement("description");
- writer.writeText(description);
- writer.endElement();
- writer.endElement();
-
- writer.startElement("shared-library-class-path");
- for (Iterator it = uris.iterator(); it.hasNext();) {
- DependencyInformation dependency = (DependencyInformation) it
- .next();
- writer.startElement("path-element");
- writer.writeText(dependency.getFilename());
- writer.endElement();
- }
- writer.endElement();
-
- writer.endElement();
- writer.endElement();
-
- close(w);
- }
-
- private void close(Writer closeable) {
- if (closeable != null) {
- try {
- closeable.close();
- } catch (Exception e) {
- // TODO: warn
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/servicemix-maven-plugins/blob/681882ee/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/MakeServiceMixDirsMojo.java
----------------------------------------------------------------------
diff --git a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/MakeServiceMixDirsMojo.java b/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/MakeServiceMixDirsMojo.java
deleted file mode 100644
index 7f41833..0000000
--- a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/MakeServiceMixDirsMojo.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.servicemix.maven.plugin.jbi;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.codehaus.plexus.util.FileUtils;
-
-/**
- * Creates a binary servicemix install directory that can then be referenced
- * by a spring.xml file for integration testing.
- *
- * @version $Id: $
- * @goal createDirs
- * @execute phase="test-compile"
- * @requiresDependencyResolution runtime
- * @description Creates the ServiceMix runtime directories
- */
-public class MakeServiceMixDirsMojo extends JbiProjectDeployerMojo {
-
- /**
- * The deploy diretory to put the service assemblies inside
- *
- * @parameter default-value="${project.build.directory}/servicemix/deploy"
- */
- private String deployDirectory;
-
- /**
- * @parameter default-value="true"
- */
- private boolean cleanStart;
-
- public void execute() throws MojoExecutionException, MojoFailureException {
-
- try {
-
- if (cleanStart) {
- getLog().info(
- "Cleaning ServiceMix root directory [" + deployDirectory
- + "]");
- File rootDir = new File(deployDirectory);
- FileUtils.deleteDirectory(rootDir);
- rootDir.mkdirs();
- }
-
- deployProject();
-
- getLog().info("Project deployed");
-
- } catch (Exception e) {
- throw new MojoExecutionException(
- "Apache ServiceMix was unable to deploy project", e);
- }
- }
-
- //@Override
- protected void deployDependency(JbiDeployableArtifact jbiDeployable, boolean doDeferExceptions) throws MojoExecutionException {
- // do nothing
- String name = jbiDeployable.getType();
- getLog().info("deployDependency: type: " + name + " dependency: " + jbiDeployable);
- if (JBI_SERVICE_ASSEMBLY.equals(name)) {
- File assemblyFile = new File(jbiDeployable.getFile());
- File outputFile = new File(deployDirectory, assemblyFile.getName());
-
- getLog().info("copying service Assembly!: " + jbiDeployable + " to: " + outputFile);
- try {
- FileUtils.copyFile(assemblyFile, outputFile);
- } catch (IOException e) {
- throw new MojoExecutionException(e.getMessage(), e);
- }
- }
- }
-
- //@Override
- protected void startDependency(JbiProjectDeployerMojo.JbiDeployableArtifact jbiDeployable) {
- // do nothing
- }
-
- //@Override
- protected void stopDependency(JbiDeployableArtifact jbiDeployable) {
- // do nothing
- }
-
- //@Override
- protected boolean isDeployed(JbiDeployableArtifact jbiDeployable) {
- return false;
- }
-}
http://git-wip-us.apache.org/repos/asf/servicemix-maven-plugins/blob/681882ee/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/ServiceMixEmbeddedMojo.java
----------------------------------------------------------------------
diff --git a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/ServiceMixEmbeddedMojo.java b/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/ServiceMixEmbeddedMojo.java
deleted file mode 100644
index 9ce1725..0000000
--- a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/ServiceMixEmbeddedMojo.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.servicemix.maven.plugin.jbi;
-
-import java.io.File;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.xbean.spring.context.FileSystemXmlApplicationContext;
-import org.springframework.beans.factory.DisposableBean;
-
-/**
- * Starts a ServiceMix JBI container in embedded mode using the servicemix.xml
- *
- * @author <a href="pdodds@apache.org">Philip Dodds</a>
- * @version $Id: GenerateComponentDescriptorMojo 314956 2005-10-12 16:27:15Z
- * brett $
- * @goal embeddedServicemix
- * @execute phase="compile"
- * @requiresDependencyResolution runtime
- * @description Starts a local servicemix instance using the servicemix config
- * provided
- */
-public class ServiceMixEmbeddedMojo extends AbstractJbiMojo {
-
- /**
- * @parameter default-value="${basedir}/src/main/resources/servicemix.xml"
- */
- private File servicemixConfig;
-
- private FileSystemXmlApplicationContext context;
-
- public void execute() throws MojoExecutionException, MojoFailureException {
-
- try {
- startServiceMix();
-
- while (true) {
- Thread.sleep(1000);
- }
-
- } catch (InterruptedException e) {
- throw new MojoFailureException("Interrupted");
- } finally {
- if (context instanceof DisposableBean) {
- try {
- ((DisposableBean) context).destroy();
- } catch (Exception e) {
- // Ignore
- }
- }
- }
-
- }
-
- private void startServiceMix() throws MojoExecutionException {
- ClassLoader old = Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(getClassLoader());
- context = new FileSystemXmlApplicationContext("file:///"
- + servicemixConfig.getAbsolutePath());
- context.getBean("jbi");
- } catch (Exception e) {
- throw new MojoExecutionException(
- "Unable to start the ServiceMix container", e);
- } finally {
- Thread.currentThread().setContextClassLoader(old);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/servicemix-maven-plugins/blob/681882ee/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/ServiceMixMojo.java
----------------------------------------------------------------------
diff --git a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/ServiceMixMojo.java b/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/ServiceMixMojo.java
deleted file mode 100644
index 26c57e9..0000000
--- a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/ServiceMixMojo.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.servicemix.maven.plugin.jbi;
-
-import java.io.File;
-
-import javax.jbi.JBIException;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.servicemix.jbi.container.JBIContainer;
-import org.codehaus.plexus.util.FileUtils;
-
-/**
- * Starts a ServiceMix JBI container and them uses the deploy project MOJO to
- * push the current project and dependencies to it
- *
- * @author <a href="pdodds@apache.org">Philip Dodds</a>
- * @version $Id: GenerateComponentDescriptorMojo 314956 2005-10-12 16:27:15Z
- * brett $
- * @goal servicemix
- * @requiresDependencyResolution runtime
- * @description installs the project (and all dependencies) to a local
- * ServiceMix instance
- */
-public class ServiceMixMojo extends JbiProjectDeployerMojo {
-
- private JBIContainer jbiContainer;
-
- /**
- * @parameter default-value="${project.build.directory}/servicemix/install"
- */
- private String installDirectory;
-
- /**
- * @parameter default-value="${project.build.directory}/servicemix/deploy"
- */
- private String deploymentDirectory;
-
- /**
- * @parameter default-value="${project.build.directory}/servicemix/rootDir"
- */
- private String rootDirectory;
-
- /**
- * @parameter default-value="true"
- */
- private boolean cleanStart;
-
- public void execute() throws MojoExecutionException, MojoFailureException {
-
- try {
-
- if (cleanStart) {
- getLog().info(
- "Cleaning ServiceMix root directory [" + rootDirectory
- + "]");
- File rootDir = new File(rootDirectory);
- FileUtils.deleteDirectory(rootDir);
- rootDir.mkdirs();
- }
-
- startServiceMix();
- deployProject();
-
- getLog().info("Project deployed");
-
- while (true) {
- Thread.sleep(1000);
- }
- } catch (Exception e) {
- stopServiceMix();
- throw new MojoExecutionException(
- "Apache ServiceMix was unable to deploy project", e);
- }
-
- }
-
- private void stopServiceMix() {
- getLog().info("Shutting down Apache ServiceMix");
- if (jbiContainer != null) {
- try {
- jbiContainer.shutDown();
- } catch (JBIException e) {
- getLog().warn(e);
- }
- }
- }
-
- private void startServiceMix() throws MojoExecutionException {
- try {
- getLog().info("Starting Apache ServiceMix");
- jbiContainer = new JBIContainer();
- jbiContainer.setRmiPort(Integer.parseInt(port));
- jbiContainer.setCreateMBeanServer(true);
- jbiContainer.setInstallationDirPath(installDirectory);
- jbiContainer.setDeploymentDirPath(deploymentDirectory);
- jbiContainer.setRootDir(rootDirectory);
- jbiContainer.init();
- jbiContainer.start();
- } catch (JBIException e) {
- throw new MojoExecutionException(
- "Unable to start the JBI container", e);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/servicemix-maven-plugins/blob/681882ee/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/XmlDescriptorHelper.java
----------------------------------------------------------------------
diff --git a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/XmlDescriptorHelper.java b/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/XmlDescriptorHelper.java
deleted file mode 100644
index 64edcc3..0000000
--- a/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/XmlDescriptorHelper.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.servicemix.maven.plugin.jbi;
-
-import javax.xml.namespace.QName;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public final class XmlDescriptorHelper {
-
- private static final transient Logger LOGGER = LoggerFactory.getLogger(XmlDescriptorHelper.class);
-
- private XmlDescriptorHelper() {
- }
-
- public static QName getServiceName(Element childElement) {
- if (childElement.hasAttribute("service-name")) {
- String prefixAndLocalPart = childElement
- .getAttribute("service-name");
- String prefix = prefixAndLocalPart.substring(0, prefixAndLocalPart
- .indexOf(':'));
- String localPart = prefixAndLocalPart.substring(prefixAndLocalPart
- .indexOf(':') + 1);
- return new QName(childElement.lookupNamespaceURI(prefix), localPart);
- }
- return null;
- }
-
- public static QName getInterfaceName(Element childElement) {
- if (childElement.hasAttribute("interface-name")) {
- String prefixAndLocalPart = childElement
- .getAttribute("interface-name");
- String prefix = prefixAndLocalPart.substring(0, prefixAndLocalPart
- .indexOf(':'));
- String localPart = prefixAndLocalPart.substring(prefixAndLocalPart
- .indexOf(':') + 1);
- return new QName(childElement.lookupNamespaceURI(prefix), localPart);
- }
- return null;
- }
-
- public static boolean isElement(Node node, String namespaceUrl,
- String localPart) {
- if (node instanceof Element) {
- Element element = (Element) node;
- LOGGER.debug("Got Element nodeName:" + element.getNodeName()
- + " namespaceUri:" + element.getNamespaceURI()
- + " localName:" + element.getLocalName());
- if (localPart.equals(element.getNodeName())) {
- return true;
- } else {
- // Compare the namespace URI and localname
- LOGGER.debug(namespaceUrl + "=" + element.getNamespaceURI()
- + " is "
- + namespaceUrl.equals(element.getNamespaceURI()));
- LOGGER.debug(localPart + "=" + element.getLocalName() + " is "
- + localPart.equals(element.getLocalName()));
- if ((namespaceUrl.equals(element.getNamespaceURI()))
- && (localPart.equals(element.getLocalName()))) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static String getEndpointName(Element childElement) {
- if (childElement.hasAttribute("endpoint-name")) {
- return childElement.getAttribute("endpoint-name");
- }
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/servicemix-maven-plugins/blob/681882ee/jbi-maven-plugin/src/main/resources/META-INF/plexus/components.xml
----------------------------------------------------------------------
diff --git a/jbi-maven-plugin/src/main/resources/META-INF/plexus/components.xml b/jbi-maven-plugin/src/main/resources/META-INF/plexus/components.xml
deleted file mode 100644
index 174b8f7..0000000
--- a/jbi-maven-plugin/src/main/resources/META-INF/plexus/components.xml
+++ /dev/null
@@ -1,164 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You 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.
-
--->
-<component-set>
- <components>
- <!--component>
- <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
- <role-hint>jar</role-hint>
- <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
- <configuration>
- <type>jar</type>
- <extension>jar</extension>
- </configuration>
- </component-->
- <component>
- <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
- <role-hint>jbi-component</role-hint>
- <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
- <configuration>
- <type>jbi-component</type>
- <extension>jar</extension>
- <language>java</language>
- </configuration>
- </component>
- <component>
- <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
- <role-hint>jbi-component</role-hint>
- <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
- <configuration>
- <phases>
- <generate-resources>org.apache.servicemix.tooling:jbi-maven-plugin:generate-jbi-component-descriptor</generate-resources>
- <process-resources>org.apache.maven.plugins:maven-resources-plugin:resources</process-resources>
- <compile>org.apache.maven.plugins:maven-compiler-plugin:compile</compile>
- <process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources>
- <test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
- <test>org.apache.maven.plugins:maven-surefire-plugin:test</test>
- <package>org.apache.maven.plugins:maven-jar-plugin:jar, org.apache.servicemix.tooling:jbi-maven-plugin:jbi-component</package>
- <install>org.apache.maven.plugins:maven-install-plugin:install</install>
- <deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
- </phases>
- </configuration>
- </component>
- <component>
- <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
- <role-hint>jbi-service-unit</role-hint>
- <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
- <configuration>
- <type>jbi-service-unit</type>
- <extension>jar</extension>
- <language>java</language>
- </configuration>
- </component>
- <component>
- <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
- <role-hint>jbi-service-unit</role-hint>
- <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
- <configuration>
- <phases>
- <process-classes>org.apache.servicemix.tooling:jbi-maven-plugin:generate-jbi-service-unit-descriptor</process-classes>
- <process-resources>org.apache.maven.plugins:maven-resources-plugin:resources,org.apache.servicemix.tooling:jbi-maven-plugin:generate-depends-file</process-resources>
- <compile>org.apache.maven.plugins:maven-compiler-plugin:compile</compile>
- <process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources>
- <test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
- <test>org.apache.maven.plugins:maven-surefire-plugin:test</test>
- <package>org.apache.maven.plugins:maven-jar-plugin:jar,org.apache.servicemix.tooling:jbi-maven-plugin:jbi-service-unit</package>
- <install>org.apache.maven.plugins:maven-install-plugin:install</install>
- <deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
- </phases>
- </configuration>
- </component>
- <component>
- <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
- <role-hint>jbi-service-assembly</role-hint>
- <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
- <configuration>
- <type>jbi-service-assembly</type>
- <extension>zip</extension>
- <language>java</language>
- </configuration>
- </component>
- <component>
- <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
- <role-hint>jbi-service-assembly</role-hint>
- <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
- <configuration>
- <phases>
- <generate-resources>org.apache.servicemix.tooling:jbi-maven-plugin:generate-jbi-service-assembly-descriptor,org.apache.servicemix.tooling:jbi-maven-plugin:generate-depends-file</generate-resources>
- <process-resources>org.apache.maven.plugins:maven-resources-plugin:resources</process-resources>
- <compile>org.apache.maven.plugins:maven-compiler-plugin:compile</compile>
- <process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources>
- <test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
- <test>org.apache.maven.plugins:maven-surefire-plugin:test</test>
- <package>org.apache.servicemix.tooling:jbi-maven-plugin:jbi-service-assembly</package>
- <install>org.apache.maven.plugins:maven-install-plugin:install</install>
- <deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
- </phases>
- </configuration>
- </component>
- <component>
- <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
- <role-hint>jbi-shared-library</role-hint>
- <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
- <configuration>
- <type>jbi-shared-library</type>
- <extension>jar</extension>
- <language>java</language>
- </configuration>
- </component>
- <component>
- <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
- <role-hint>jbi-shared-library</role-hint>
- <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
- <configuration>
- <phases>
- <generate-resources>org.apache.servicemix.tooling:jbi-maven-plugin:generate-jbi-shared-library-descriptor,org.apache.servicemix.tooling:jbi-maven-plugin:generate-depends-file</generate-resources>
- <process-resources>org.apache.maven.plugins:maven-resources-plugin:resources</process-resources>
- <compile>org.apache.maven.plugins:maven-compiler-plugin:compile</compile>
- <process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources>
- <test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
- <test>org.apache.maven.plugins:maven-surefire-plugin:test</test>
- <package>org.apache.maven.plugins:maven-jar-plugin:jar,
- org.apache.servicemix.tooling:jbi-maven-plugin:jbi-shared-library</package>
- <install>org.apache.maven.plugins:maven-install-plugin:install</install>
- <deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
- </phases>
- </configuration>
- </component>
- <component>
- <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
- <role-hint>itest</role-hint>
- <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
- <configuration>
- <phases>
- <generate-resources>org.apache.servicemix.tooling:jbi-maven-plugin:generate-depends-file</generate-resources>
- <process-resources>org.apache.maven.plugins:maven-resources-plugin:resources</process-resources>
- <compile>org.apache.maven.plugins:maven-compiler-plugin:compile</compile>
- <process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources>
- <test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
- <test>org.apache.maven.plugins:maven-surefire-plugin:test</test>
- <package>org.apache.maven.plugins:maven-jar-plugin:jar</package>
- <install>org.apache.maven.plugins:maven-install-plugin:install</install>
- <deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
- </phases>
- </configuration>
- </component>
-
-</components>
-</component-set>
http://git-wip-us.apache.org/repos/asf/servicemix-maven-plugins/blob/681882ee/jbi-maven-plugin/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/jbi-maven-plugin/src/main/resources/log4j.properties b/jbi-maven-plugin/src/main/resources/log4j.properties
deleted file mode 100644
index 9216cb9..0000000
--- a/jbi-maven-plugin/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-#
-
-#
-# The logging properties used during tests..
-#
-log4j.rootLogger=INFO, stdout
-
-log4j.logger.javax.jbi=INFO
-log4j.logger.org.apache.activemq=INFO
-log4j.logger.org.apache.activemq.spring=WARN
-log4j.logger.org.apache.activemq.store.journal=INFO
-log4j.logger.org.activeio.journal=INFO
-
-# CONSOLE appender not used by default
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
-
-# File appender
-log4j.appender.out=org.apache.log4j.FileAppender
-log4j.appender.out.layout=org.apache.log4j.PatternLayout
-log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
-log4j.appender.out.file=target/servicemix.log
-log4j.appender.out.append=true