You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2007/11/09 21:39:14 UTC
svn commit: r593645 - in /incubator/servicemix/branches/servicemix-4.0: ./
tooling/ tooling/depends-maven-plugin/ tooling/depends-maven-plugin/src/
tooling/depends-maven-plugin/src/main/
tooling/depends-maven-plugin/src/main/java/ tooling/depends-maven...
Author: gnodet
Date: Fri Nov 9 12:39:13 2007
New Revision: 593645
URL: http://svn.apache.org/viewvc?rev=593645&view=rev
Log:
Add maven plugin to determine dependency version
Added:
incubator/servicemix/branches/servicemix-4.0/tooling/ (with props)
incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/ (with props)
incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/pom.xml
incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/src/
incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/src/main/
incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/src/main/java/
incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/src/main/java/org/
incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/src/main/java/org/apache/
incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/src/main/java/org/apache/servicemix/
incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/src/main/java/org/apache/servicemix/tooling/
incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/src/main/java/org/apache/servicemix/tooling/depends/
incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/src/main/java/org/apache/servicemix/tooling/depends/GenerateDependsFileMojo.java
incubator/servicemix/branches/servicemix-4.0/tooling/pom.xml
Modified:
incubator/servicemix/branches/servicemix-4.0/pom.xml
Modified: incubator/servicemix/branches/servicemix-4.0/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-4.0/pom.xml?rev=593645&r1=593644&r2=593645&view=diff
==============================================================================
--- incubator/servicemix/branches/servicemix-4.0/pom.xml (original)
+++ incubator/servicemix/branches/servicemix-4.0/pom.xml Fri Nov 9 12:39:13 2007
@@ -29,6 +29,7 @@
<name>ServiceMix</name>
<modules>
+ <module>tooling</module>
<module>nmr</module>
<module>camel</module>
<module>bundles</module>
@@ -71,9 +72,22 @@
<gshell.version>1.0-alpha-1-SNAPSHOT</gshell.version>
<acegi.version>1.0.0</acegi.version>
<cxf.version>2.0.2-incubator</cxf.version>
+ <xbean.version>3.2</xbean.version>
</properties>
<repositories>
+ <!-- Default repository -->
+ <repository>
+ <id>maven-repo</id>
+ <name>Default maven repo</name>
+ <url>http://repo1.maven.org/maven2</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
<!-- I21 repository -->
<repository>
<id>i21-s3-maven-repo</id>
@@ -162,11 +176,26 @@
<dependencyManagement>
<dependencies>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>org.apache.servicemix.jaxws</artifactId>
- <version>${project.version}</version>
- </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix.bundles</groupId>
+ <artifactId>org.apache.servicemix.bundles.aopalliance</artifactId>
+ <version>1.0-4.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix.bundles</groupId>
+ <artifactId>org.apache.servicemix.bundles.jaxb-api</artifactId>
+ <version>2.0-4.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix.bundles</groupId>
+ <artifactId>org.apache.servicemix.bundles.jaxb-impl</artifactId>
+ <version>2.0.3-4.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix.bundles</groupId>
+ <artifactId>org.apache.servicemix.bundles.httpcore</artifactId>
+ <version>4.0-alpha5-4.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.servicemix.nmr</groupId>
<artifactId>org.apache.servicemix.nmr.api</artifactId>
@@ -228,6 +257,46 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.servicemix.jbi</groupId>
+ <artifactId>org.apache.servicemix.jbi.deployer</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix.jbi</groupId>
+ <artifactId>org.apache.servicemix.jbi.offline</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>org.apache.servicemix.camel</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>org.apache.servicemix.jaxws</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix.examples</groupId>
+ <artifactId>org.apache.servicemix.examples.intermediary</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix.examples</groupId>
+ <artifactId>org.apache.servicemix.examples.jaxws</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ <version>${camel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jms</artifactId>
+ <version>${camel.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>${camel.version}</version>
@@ -421,6 +490,11 @@
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.13</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-classloader</artifactId>
+ <version>${xbean.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
Propchange: incubator/servicemix/branches/servicemix-4.0/tooling/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Nov 9 12:39:13 2007
@@ -0,0 +1,4 @@
+target
+*.iml
+*.ipr
+*.iws
Propchange: incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Nov 9 12:39:13 2007
@@ -0,0 +1,4 @@
+target
+*.iml
+*.ipr
+*.iws
Added: incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/pom.xml?rev=593645&view=auto
==============================================================================
--- incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/pom.xml (added)
+++ incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/pom.xml Fri Nov 9 12:39:13 2007
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+
+ <!--
+
+ 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.
+ -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix.tooling</groupId>
+ <artifactId>tooling</artifactId>
+ <version>4.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix.tooling</groupId>
+ <artifactId>depends-maven-plugin</artifactId>
+ <packaging>maven-plugin</packaging>
+ <version>4.0-SNAPSHOT</version>
+ <name>ServiceMix Tooing Depends plugin</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+ </dependencies>
+
+</project>
Added: incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/src/main/java/org/apache/servicemix/tooling/depends/GenerateDependsFileMojo.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/src/main/java/org/apache/servicemix/tooling/depends/GenerateDependsFileMojo.java?rev=593645&view=auto
==============================================================================
--- incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/src/main/java/org/apache/servicemix/tooling/depends/GenerateDependsFileMojo.java (added)
+++ incubator/servicemix/branches/servicemix-4.0/tooling/depends-maven-plugin/src/main/java/org/apache/servicemix/tooling/depends/GenerateDependsFileMojo.java Fri Nov 9 12:39:13 2007
@@ -0,0 +1,115 @@
+/*
+ * 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.tooling.depends;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.util.Date;
+import java.util.Iterator;
+
+import org.apache.maven.model.Dependency;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+
+/**
+ * Generates the dependencies properties file
+ *
+ * @version $Id: $
+ * @goal generate-depends-file
+ * @phase generate-resources
+ * @requiresDependencyResolution runtime
+ * @description Generates the dependencies properties file
+ */
+public class GenerateDependsFileMojo extends AbstractMojo {
+
+ protected static final String SEPARATOR = "/";
+
+ /**
+ * The maven project.
+ *
+ * @parameter expression="${project}"
+ * @required
+ * @readonly
+ */
+ protected MavenProject project;
+
+ /**
+ * The file to generate
+ *
+ * @parameter default-value="${project.build.directory}/classes/META-INF/maven/dependencies.properties"
+ */
+
+ private File outputFile;
+
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ OutputStream out = null;
+ try {
+ outputFile.getParentFile().mkdirs();
+ out = new FileOutputStream(outputFile);
+ PrintStream printer = new PrintStream(out);
+ populateProperties(printer);
+ getLog().info("Created: " + outputFile);
+
+ } catch (Exception e) {
+ throw new MojoExecutionException(
+ "Unable to create dependencies file: " + e, e);
+ } finally {
+ if (out != null) {
+ try {
+ out.close();
+ } catch (IOException e) {
+ getLog().info("Failed to close: " + outputFile + ". Reason: " + e, e);
+ }
+ }
+ }
+ }
+
+ protected void populateProperties(PrintStream out) {
+ out.println("# Project dependencies generated by the Apache ServiceMix Maven Plugin");
+ out.println("# Generated at: " + new Date());
+ out.println();
+
+ out.println("groupId = " + project.getGroupId());
+ out.println("artifactId = " + project.getArtifactId());
+ out.println("version = " + project.getVersion());
+ out.println(project.getGroupId() + SEPARATOR + project.getArtifactId() + SEPARATOR + "version = " + project.getVersion());
+ out.println();
+ out.println("# dependencies");
+ out.println();
+
+ Iterator iterator = project.getDependencies().iterator();
+ while (iterator.hasNext()) {
+ Dependency dependency = (Dependency) iterator.next();
+ String prefix = dependency.getGroupId() + SEPARATOR + dependency.getArtifactId() + SEPARATOR;
+ out.println(prefix + "version = " + dependency.getVersion());
+ String classifier = dependency.getClassifier();
+ if (classifier != null) {
+ out.println(prefix + "classifier = " + classifier);
+ }
+ out.println(prefix + "type = " + dependency.getType());
+ out.println(prefix + "scope = " + dependency.getScope());
+ out.println();
+
+ getLog().debug("Dependency: " + dependency + " classifier: " + classifier + " type: " + dependency.getType());
+ }
+ }
+}
\ No newline at end of file
Added: incubator/servicemix/branches/servicemix-4.0/tooling/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-4.0/tooling/pom.xml?rev=593645&view=auto
==============================================================================
--- incubator/servicemix/branches/servicemix-4.0/tooling/pom.xml (added)
+++ incubator/servicemix/branches/servicemix-4.0/tooling/pom.xml Fri Nov 9 12:39:13 2007
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+
+ <!--
+
+ 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.
+ -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix</artifactId>
+ <version>4.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix.tooling</groupId>
+ <artifactId>tooling</artifactId>
+ <packaging>pom</packaging>
+ <version>4.0-SNAPSHOT</version>
+ <name>ServiceMix Tooling</name>
+
+ <modules>
+ <module>depends-maven-plugin</module>
+ </modules>
+
+</project>