]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Use commons as parent
authorMathieu Baudier <mbaudier@argeo.org>
Wed, 8 Dec 2010 09:56:47 +0000 (09:56 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Wed, 8 Dec 2010 09:56:47 +0000 (09:56 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@3957 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

18 files changed:
dep/org.argeo.slc.dep.server/pom.xml
dist/org.argeo.slc.sdk/pom.xml
integration-tests/org.argeo.slc.it.webapp/pom.xml
pom.xml
runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/MavenDeployEnvironment.java
runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/MavenManager.java
runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/SlcMavenEmbedder.java [deleted file]
runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/AbstractMavenEmbedderLogger.java [deleted file]
runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/MavenEmbedderConsoleLogger.java [deleted file]
runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/MavenEmbedderException.java [deleted file]
runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/MavenEmbedderLogger.java [deleted file]
runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/MavenEmbedderLoggerManager.java [deleted file]
runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/PlexusLoggerAdapter.java [deleted file]
runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/SummaryPluginDescriptor.java [deleted file]
runtime/org.argeo.slc.support.osgi/pom.xml
runtime/org.argeo.slc.support.ws.client/.classpath
runtime/org.argeo.slc.support.ws.client/.project
runtime/org.argeo.slc.support.ws.client/pom.xml

index 35ec958917162d268ac38aa93cfb961fea8b79db..3fd01d47947033ea2f43472fa98210606ece3b51 100644 (file)
                        <groupId>org.argeo.slc.runtime</groupId>
                        <artifactId>org.argeo.slc.support.jcr</artifactId>
                </dependency>
+               <dependency>
+                       <groupId>org.argeo.slc.runtime</groupId>
+                       <artifactId>org.argeo.slc.support.ws.client</artifactId>
+                       <version>${project.version}</version>
+               </dependency>
 
                <!-- Commons -->
                <dependency>
index 901e7dd1a6a15a022b77deea855b118f18cbb0da..e60e73a88f4d6c60d186ea984935e2ea711bcf3c 100644 (file)
@@ -7,7 +7,7 @@
        </parent>
        <groupId>org.argeo.slc.dist</groupId>
        <artifactId>org.argeo.slc.sdk</artifactId>
-       <packaging>jar</packaging>
+       <packaging>pom</packaging>
        <name>SLC SDK</name>
        <properties>
                <argeo.p2.cmd>/opt/equinox-p2-agent/eclipse</argeo.p2.cmd>
index 034317318dfb17a9fe8c406ce84ce7e5ac5d66fb..18f192bc6efc845baf26e97422583d15c9d143e0 100644 (file)
                                        </execution>
                                </executions>
                        </plugin>
+                               <plugin>
+                                       <artifactId>maven-jar-plugin</artifactId>
+                                       <configuration>
+                                               <archive>
+                                                       <manifestFile>META-INF/MANIFEST.MF</manifestFile>
+                                               </archive>
+                                       </configuration>
+                               </plugin>
                </plugins>
        </build>
        <dependencies>
diff --git a/pom.xml b/pom.xml
index e8fca2fdd2e147eddd49e09faf6f85bf0b52465b..607a12dd0476bc13121996ed56a44c5b273127cb 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -1,9 +1,10 @@
-<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">
+<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>
        <parent>
-               <groupId>org.argeo</groupId>
-               <artifactId>parent</artifactId>
-               <version>1.2.0</version>
+               <groupId>org.argeo.commons</groupId>
+               <artifactId>argeo-commons</artifactId>
+               <version>0.2.2-SNAPSHOT</version>
        </parent>
        <groupId>org.argeo.slc</groupId>
        <artifactId>argeo-slc</artifactId>
        <version>0.13.1-SNAPSHOT</version>
        <properties>
                <developmentCycle>0.13</developmentCycle>
-               <version.argeo-distribution>1.1.0</version.argeo-distribution>
-               <version.argeo-ria>0.12.5</version.argeo-ria>
-               <version.argeo-commons>0.2.1</version.argeo-commons>
-               <version.equinox>3.6.1</version.equinox>
-               <version.maven-bundle-plugin>2.0.1</version.maven-bundle-plugin>
-               <version.maven-argeo-osgi>0.1.29</version.maven-argeo-osgi>
-               <version.maven-argeo-qooxdoo>1.1.0</version.maven-argeo-qooxdoo>
                <site.repoBase>file:///srv/projects/www/slc/site</site.repoBase>
                <site.urlBase>http://projects.argeo.org/slc/site</site.urlBase>
        </properties>
                <developerConnection>scm:svn:https://svn.argeo.org/slc/trunk</developerConnection>
                <url>https://svn.argeo.org/slc/trunk</url>
        </scm>
-       <issueManagement>
-               <system>Bugzilla</system>
-               <url>https://bugzilla.argeo.org</url>
-       </issueManagement>
        <licenses>
                <license>
                        <name>Apache 2</name>
@@ -68,10 +58,6 @@ limitations under the License.
                        </comments>
                </license>
        </licenses>
-       <organization>
-               <name>Argeo</name>
-               <url>http://www.argeo.org</url>
-       </organization>
        <developers>
                <developer>
                        <id>mbaudier</id>
@@ -118,112 +104,8 @@ limitations under the License.
                        </roles>
                </contributor>
        </contributors>
-       <build>
-               <pluginManagement>
-                       <plugins>
-                               <plugin>
-                                       <groupId>org.apache.maven.plugins</groupId>
-                                       <artifactId>maven-compiler-plugin</artifactId>
-                                       <configuration>
-                                               <source>1.5</source>
-                                               <target>1.5</target>
-                                       </configuration>
-                               </plugin>
-                               <plugin>
-                                       <groupId>org.apache.maven.plugins</groupId>
-                                       <artifactId>maven-source-plugin</artifactId>
-                                       <executions>
-                                               <execution>
-                                                       <id>attach-sources</id>
-                                                       <phase>package</phase>
-                                                       <goals>
-                                                               <goal>jar</goal>
-                                                       </goals>
-                                               </execution>
-                                       </executions>
-                               </plugin>
-                               <plugin>
-                                       <groupId>org.argeo.maven.plugins</groupId>
-                                       <artifactId>maven-argeo-osgi-plugin</artifactId>
-                                       <version>${version.maven-argeo-osgi}</version>
-                               </plugin>
-                       </plugins>
-               </pluginManagement>
-               <plugins>
-                       <plugin>
-                               <groupId>org.codehaus.mojo</groupId>
-                               <artifactId>buildnumber-maven-plugin</artifactId>
-                               <executions>
-                                       <execution>
-                                               <phase>validate</phase>
-                                               <goals>
-                                                       <goal>create</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                               <configuration>
-                                       <doCheck>false</doCheck>
-                                       <doUpdate>false</doUpdate>
-                                       <useLastCommittedRevision>true</useLastCommittedRevision>
-                               </configuration>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-resources-plugin</artifactId>
-                               <configuration>
-                                       <encoding>UTF-8</encoding>
-                               </configuration>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-site-plugin</artifactId>
-                               <version>2.1.1</version>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-release-plugin</artifactId>
-                               <configuration>
-                                       <autoVersionSubmodules>true</autoVersionSubmodules>
-                                       <releaseProfiles>release</releaseProfiles>
-                                       <preparationGoals>clean install</preparationGoals>
-                               </configuration>
-                       </plugin>
-                       <plugin>
-                               <groupId>com.mycila.maven-license-plugin</groupId>
-                               <artifactId>maven-license-plugin</artifactId>
-                               <configuration>
-                                       <header>license-apache2-header.txt</header>
-                                       <failIfMissing>true</failIfMissing>
-                                       <aggregate>true</aggregate>
-                                       <includes>
-                                               <include>src/**/*.java</include>
-                                               <include>src/**/*.xml</include>
-                                       </includes>
-                                       <excludes>
-                                               <exclude>**/springutil/**</exclude>
-                                               <exclude>**/qooxdoo-sdk/**</exclude>
-                                       </excludes>
-                                       <useDefaultExcludes>true</useDefaultExcludes>
-                                       <mapping>
-                                               <java>SLASHSTAR_STYLE</java>
-                                               <xml>XML_STYLE</xml>
-                                       </mapping>
-                               </configuration>
-                       </plugin>
-               </plugins>
-
-       </build>
        <dependencyManagement>
                <dependencies>
-                       <!-- Third Parties -->
-                       <dependency>
-                               <groupId>org.argeo.dep</groupId>
-                               <artifactId>versions-all</artifactId>
-                               <version>${version.argeo-distribution}</version>
-                               <type>pom</type>
-                               <scope>import</scope>
-                       </dependency>
-
                        <!-- SLC (itself) -->
                        <dependency>
                                <groupId>org.argeo.slc.runtime</groupId>
@@ -383,6 +265,20 @@ limitations under the License.
                                <checksumPolicy>fail</checksumPolicy>
                        </snapshots>
                </repository>
+               <repository>
+                       <id>argeo-snapshots</id>
+                       <url>http://dev.argeo.org/maven/argeo-snapshots</url>
+                       <releases>
+                               <enabled>false</enabled>
+                               <updatePolicy>never</updatePolicy>
+                               <checksumPolicy>fail</checksumPolicy>
+                       </releases>
+                       <snapshots>
+                               <enabled>true</enabled>
+                               <updatePolicy>always</updatePolicy>
+                               <checksumPolicy>fail</checksumPolicy>
+                       </snapshots>
+               </repository>
        </repositories>
        <distributionManagement>
                <site>
index 93db6837c16db20ff5ba1df9b33a47a579b573e1..2bef26e146e74d16da6766c8b907e19ac13515db 100644 (file)
@@ -34,14 +34,15 @@ public abstract class MavenDeployEnvironment implements DeployEnvironment {
 
        public void unpackTo(Object packg, File targetLocation,
                        Map<String, String> filter) {
-               File packageLocation;
+               File packageLocation=null;
                String type = null;
                String removeRootDir = "enabled";
-               if (packg instanceof MavenFile) {
-                       packageLocation = mavenManager
-                                       .getPackageLocation((MavenFile) packg);
-                       type = ((MavenFile) packg).getType();
-               } else if (packg instanceof File) {
+//             if (packg instanceof MavenFile) {
+//                     packageLocation = mavenManager
+//                                     .getPackageLocation((MavenFile) packg);
+//                     type = ((MavenFile) packg).getType();
+//             } else 
+               if (packg instanceof File) {
                        packageLocation = (File) packg;
                        // TODO: type based on extension
                } else {
index a78588c2e4473aea128ef222489e7d6f5c4820ea..2c6fddd4b42b50d93e0edc9d06d29493b04a2049 100644 (file)
 \r
 package org.argeo.slc.maven;\r
 \r
-import java.io.File;\r
-import java.util.List;\r
-import java.util.Set;\r
-import java.util.Vector;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-import org.apache.maven.artifact.Artifact;\r
-import org.apache.maven.artifact.factory.ArtifactFactory;\r
-import org.apache.maven.artifact.metadata.ArtifactMetadataSource;\r
-import org.apache.maven.artifact.repository.ArtifactRepository;\r
-import org.apache.maven.artifact.resolver.ArtifactResolutionResult;\r
-import org.apache.maven.artifact.resolver.ArtifactResolver;\r
-import org.apache.maven.project.MavenProject;\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.maven.embedder.MavenEmbedderException;\r
-import org.codehaus.plexus.embed.Embedder;\r
+import org.apache.maven.cli.MavenCli;\r
+import org.codehaus.plexus.PlexusContainer;\r
+\r
+\r
 \r
 public class MavenManager {\r
+       \r
+       public static void main(String[] args){\r
+               //CustomCli mavenCli = new CustomCli();\r
+               MavenCli mavenCli = new MavenCli();\r
+               String[] goals = { "-e","dependency:tree" };\r
+               mavenCli.doMain(goals, "/home/mbaudier/dev/src/slc/dist/org.argeo.slc.sdk", System.out, System.err);\r
+       }\r
+       \r
+       static class CustomCli extends MavenCli{\r
+               private PlexusContainer container;\r
+\r
+               @Override\r
+               protected void customizeContainer(PlexusContainer container) {\r
+                       this.container = container;\r
+               }\r
 \r
+               public PlexusContainer getContainer() {\r
+                       return container;\r
+               }\r
+               \r
+               \r
+               \r
+       }\r
+/*\r
        private final Log log = LogFactory.getLog(getClass());\r
 \r
        private String localRepositoryPath = System.getProperty("user.home")\r
@@ -45,7 +55,7 @@ public class MavenManager {
        private List<ArtifactRepository> remoteRepositoriesInternal;\r
        private List<RemoteRepository> remoteRepositories = new Vector<RemoteRepository>();\r
 \r
-       private SlcMavenEmbedder mavenEmbedder;\r
+       private MavenEmbedder mavenEmbedder;\r
        private ClassLoader classLoader;\r
        private Boolean offline = false;\r
 \r
@@ -220,5 +230,5 @@ public class MavenManager {
        public void setOffline(Boolean offline) {\r
                this.offline = offline;\r
        }\r
-\r
+*/\r
 }\r
diff --git a/runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/SlcMavenEmbedder.java b/runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/SlcMavenEmbedder.java
deleted file mode 100644 (file)
index ee12d06..0000000
+++ /dev/null
@@ -1,717 +0,0 @@
-/*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
- *
- * 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.
- */
-
-package org.argeo.slc.maven;
-
-/*
- * Copyright 2001-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.
- */
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.maven.BuildFailureException;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.manager.WagonManager;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
-import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.execution.MavenSession;
-import org.apache.maven.execution.ReactorManager;
-import org.apache.maven.lifecycle.LifecycleExecutionException;
-import org.apache.maven.lifecycle.LifecycleExecutor;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
-import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
-import org.apache.maven.monitor.event.DefaultEventDispatcher;
-import org.apache.maven.monitor.event.EventDispatcher;
-import org.apache.maven.monitor.event.EventMonitor;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.descriptor.PluginDescriptor;
-import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
-import org.apache.maven.profiles.DefaultProfileManager;
-import org.apache.maven.profiles.ProfileManager;
-import org.apache.maven.project.DuplicateProjectException;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
-import org.apache.maven.project.ProjectBuildingException;
-import org.apache.maven.settings.MavenSettingsBuilder;
-import org.apache.maven.settings.RuntimeInfo;
-import org.apache.maven.settings.Settings;
-import org.apache.maven.wagon.events.TransferListener;
-import org.argeo.slc.maven.embedder.MavenEmbedderException;
-import org.argeo.slc.maven.embedder.MavenEmbedderLogger;
-import org.argeo.slc.maven.embedder.MavenEmbedderLoggerManager;
-import org.argeo.slc.maven.embedder.PlexusLoggerAdapter;
-import org.argeo.slc.maven.embedder.SummaryPluginDescriptor;
-import org.codehaus.classworlds.ClassWorld;
-import org.codehaus.classworlds.DuplicateRealmException;
-import org.codehaus.plexus.PlexusContainerException;
-import org.codehaus.plexus.component.repository.ComponentDescriptor;
-import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
-import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
-import org.codehaus.plexus.configuration.PlexusConfiguration;
-import org.codehaus.plexus.configuration.PlexusConfigurationException;
-import org.codehaus.plexus.embed.Embedder;
-import org.codehaus.plexus.util.DirectoryScanner;
-import org.codehaus.plexus.util.dag.CycleDetectedException;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-
-/**
- * Class intended to be used by clients who wish to embed Maven into their
- * applications
- * 
- * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
- */
-public class SlcMavenEmbedder {
-       public static final String userHome = System.getProperty("user.home");
-
-       // ----------------------------------------------------------------------
-       // Embedder
-       // ----------------------------------------------------------------------
-
-       private Embedder embedder;
-
-       // ----------------------------------------------------------------------
-       // Components
-       // ----------------------------------------------------------------------
-
-       private MavenProjectBuilder mavenProjectBuilder;
-
-       private ArtifactRepositoryFactory artifactRepositoryFactory;
-
-       private MavenSettingsBuilder settingsBuilder;
-
-       private LifecycleExecutor lifecycleExecutor;
-
-       private WagonManager wagonManager;
-
-       private MavenXpp3Reader modelReader;
-
-       private MavenXpp3Writer modelWriter;
-
-       private ProfileManager profileManager;
-
-       private PluginDescriptorBuilder pluginDescriptorBuilder;
-
-       private ArtifactFactory artifactFactory;
-
-       private ArtifactResolver artifactResolver;
-
-       private ArtifactRepositoryLayout defaultArtifactRepositoryLayout;
-
-       // ----------------------------------------------------------------------
-       // Configuration
-       // ----------------------------------------------------------------------
-
-       private Settings settings;
-
-       private ArtifactRepository localRepository;
-
-       private File localRepositoryDirectory;
-
-       private ClassLoader classLoader;
-
-       private MavenEmbedderLogger logger;
-
-       // ----------------------------------------------------------------------
-       // User options
-       // ----------------------------------------------------------------------
-
-       // release plugin uses this but in IDE there will probably always be some
-       // form of interaction.
-       private boolean interactiveMode;
-
-       private boolean offline;
-
-       private String globalChecksumPolicy;
-
-       /**
-        * This option determines whether the embedder is to be aligned to the user
-        * installation.
-        */
-       private boolean alignWithUserInstallation;
-
-       // ----------------------------------------------------------------------
-       // Accessors
-       // ----------------------------------------------------------------------
-
-       public void setInteractiveMode(boolean interactiveMode) {
-               this.interactiveMode = interactiveMode;
-       }
-
-       public boolean isInteractiveMode() {
-               return interactiveMode;
-       }
-
-       public void setOffline(boolean offline) {
-               this.offline = offline;
-       }
-
-       public boolean isOffline() {
-               return offline;
-       }
-
-       public void setGlobalChecksumPolicy(String globalChecksumPolicy) {
-               this.globalChecksumPolicy = globalChecksumPolicy;
-       }
-
-       public String getGlobalChecksumPolicy() {
-               return globalChecksumPolicy;
-       }
-
-       public boolean isAlignWithUserInstallation() {
-               return alignWithUserInstallation;
-       }
-
-       public void setAlignWithUserInstallation(boolean alignWithUserInstallation) {
-               this.alignWithUserInstallation = alignWithUserInstallation;
-       }
-
-       /**
-        * Set the classloader to use with the maven embedder.
-        * 
-        * @param classLoader
-        */
-       public void setClassLoader(ClassLoader classLoader) {
-               this.classLoader = classLoader;
-       }
-
-       public ClassLoader getClassLoader() {
-               return classLoader;
-       }
-
-       public void setLocalRepositoryDirectory(File localRepositoryDirectory) {
-               this.localRepositoryDirectory = localRepositoryDirectory;
-       }
-
-       public File getLocalRepositoryDirectory() {
-               return localRepositoryDirectory;
-       }
-
-       public ArtifactRepository getLocalRepository() {
-               return localRepository;
-       }
-
-       public MavenEmbedderLogger getLogger() {
-               return logger;
-       }
-
-       public void setLogger(MavenEmbedderLogger logger) {
-               this.logger = logger;
-       }
-
-       // ----------------------------------------------------------------------
-       // Embedder Client Contract
-       // ----------------------------------------------------------------------
-
-       // ----------------------------------------------------------------------
-       // Model
-       // ----------------------------------------------------------------------
-
-       public Model readModel(File model) throws XmlPullParserException,
-                       FileNotFoundException, IOException {
-               return modelReader.read(new FileReader(model));
-       }
-
-       public void writeModel(Writer writer, Model model) throws IOException {
-               modelWriter.write(writer, model);
-       }
-
-       // ----------------------------------------------------------------------
-       // Project
-       // ----------------------------------------------------------------------
-
-       public MavenProject readProject(File mavenProject)
-                       throws ProjectBuildingException {
-               return mavenProjectBuilder.build(mavenProject, localRepository,
-                               profileManager);
-       }
-
-       public MavenProject readProjectWithDependencies(File mavenProject,
-                       TransferListener transferListener) throws ProjectBuildingException,
-                       ArtifactResolutionException, ArtifactNotFoundException {
-               return mavenProjectBuilder.buildWithDependencies(mavenProject,
-                               localRepository, profileManager, transferListener);
-       }
-
-       public MavenProject readProjectWithDependencies(File mavenProject)
-                       throws ProjectBuildingException, ArtifactResolutionException,
-                       ArtifactNotFoundException {
-               return mavenProjectBuilder.buildWithDependencies(mavenProject,
-                               localRepository, profileManager);
-       }
-
-       public List collectProjects(File basedir, String[] includes,
-                       String[] excludes) throws MojoExecutionException {
-               List projects = new ArrayList();
-
-               List poms = getPomFiles(basedir, includes, excludes);
-
-               for (Iterator i = poms.iterator(); i.hasNext();) {
-                       File pom = (File) i.next();
-
-                       try {
-                               MavenProject p = readProject(pom);
-
-                               projects.add(p);
-
-                       } catch (ProjectBuildingException e) {
-                               throw new MojoExecutionException("Error loading " + pom, e);
-                       }
-               }
-
-               return projects;
-       }
-
-       // ----------------------------------------------------------------------
-       // Artifacts
-       // ----------------------------------------------------------------------
-
-       public Artifact createArtifact(String groupId, String artifactId,
-                       String version, String scope, String type) {
-               return artifactFactory.createArtifact(groupId, artifactId, version,
-                               scope, type);
-       }
-
-       public Artifact createArtifactWithClassifier(String groupId,
-                       String artifactId, String version, String type, String classifier) {
-               return artifactFactory.createArtifactWithClassifier(groupId,
-                               artifactId, version, type, classifier);
-       }
-
-       public void resolve(Artifact artifact, List remoteRepositories,
-                       ArtifactRepository localRepository)
-                       throws ArtifactResolutionException, ArtifactNotFoundException {
-               artifactResolver.resolve(artifact, remoteRepositories, localRepository);
-       }
-
-       // ----------------------------------------------------------------------
-       // Plugins
-       // ----------------------------------------------------------------------
-
-       public List getAvailablePlugins() {
-               List plugins = new ArrayList();
-
-               plugins.add(makeMockPlugin("org.apache.maven.plugins",
-                               "maven-jar-plugin", "Maven Jar Plug-in"));
-
-               plugins.add(makeMockPlugin("org.apache.maven.plugins",
-                               "maven-compiler-plugin", "Maven Compiler Plug-in"));
-
-               return plugins;
-       }
-
-       public PluginDescriptor getPluginDescriptor(
-                       SummaryPluginDescriptor summaryPluginDescriptor)
-                       throws MavenEmbedderException {
-               PluginDescriptor pluginDescriptor;
-
-               try {
-                       InputStream is = classLoader.getResourceAsStream("/plugins/"
-                                       + summaryPluginDescriptor.getArtifactId() + ".xml");
-
-                       pluginDescriptor = pluginDescriptorBuilder
-                                       .build(new InputStreamReader(is));
-               } catch (PlexusConfigurationException e) {
-                       throw new MavenEmbedderException(
-                                       "Error retrieving plugin descriptor.", e);
-               }
-
-               return pluginDescriptor;
-       }
-
-       private SummaryPluginDescriptor makeMockPlugin(String groupId,
-                       String artifactId, String name) {
-               return new SummaryPluginDescriptor(groupId, artifactId, name);
-       }
-
-       // ----------------------------------------------------------------------
-       // Execution of phases/goals
-       // ----------------------------------------------------------------------
-
-       // TODO: should we allow the passing in of a settings object so that
-       // everything can be taken from the client env
-       // TODO: transfer listener
-       // TODO: logger
-
-       public void execute(MavenProject project, List goals,
-                       EventMonitor eventMonitor, TransferListener transferListener,
-                       Properties properties, File executionRootDirectory)
-                       throws CycleDetectedException, LifecycleExecutionException,
-                       BuildFailureException, DuplicateProjectException {
-               execute(Collections.singletonList(project), goals, eventMonitor,
-                               transferListener, properties, executionRootDirectory);
-       }
-
-       public void execute(List projects, List goals, EventMonitor eventMonitor,
-                       TransferListener transferListener, Properties properties,
-                       File executionRootDirectory) throws CycleDetectedException,
-                       LifecycleExecutionException, BuildFailureException,
-                       DuplicateProjectException {
-               ReactorManager rm = new ReactorManager(projects);
-
-               EventDispatcher eventDispatcher = new DefaultEventDispatcher();
-
-               eventDispatcher.addEventMonitor(eventMonitor);
-
-               // If this option is set the exception seems to be hidden ...
-
-               // rm.setFailureBehavior( ReactorManager.FAIL_AT_END );
-
-               rm.setFailureBehavior(ReactorManager.FAIL_FAST);
-
-               MavenSession session = new MavenSession(embedder.getContainer(),
-                               settings, localRepository, eventDispatcher, rm, goals,
-                               executionRootDirectory.getAbsolutePath(), properties,
-                               new Date());
-
-               session.setUsingPOMsFromFilesystem(true);
-
-               if (transferListener != null) {
-                       wagonManager.setDownloadMonitor(transferListener);
-               }
-
-               // ----------------------------------------------------------------------
-               // Maven should not be using system properties internally but because
-               // it does for now I'll just take properties that are handed to me
-               // and set them so that the plugin expression evaluator will work
-               // as expected.
-               // ----------------------------------------------------------------------
-
-               if (properties != null) {
-                       for (Iterator i = properties.keySet().iterator(); i.hasNext();) {
-                               String key = (String) i.next();
-
-                               String value = properties.getProperty(key);
-
-                               System.setProperty(key, value);
-                       }
-               }
-
-               lifecycleExecutor.execute(session, rm, session.getEventDispatcher());
-       }
-
-       // ----------------------------------------------------------------------
-       // Lifecycle information
-       // ----------------------------------------------------------------------
-
-       public List getLifecyclePhases() throws MavenEmbedderException {
-               List phases = new ArrayList();
-
-               ComponentDescriptor descriptor = embedder.getContainer()
-                               .getComponentDescriptor(LifecycleExecutor.ROLE);
-
-               PlexusConfiguration configuration = descriptor.getConfiguration();
-
-               PlexusConfiguration[] phasesConfigurations = configuration.getChild(
-                               "lifecycles").getChild(0).getChild("phases").getChildren(
-                               "phase");
-
-               try {
-                       for (int i = 0; i < phasesConfigurations.length; i++) {
-                               phases.add(phasesConfigurations[i].getValue());
-                       }
-               } catch (PlexusConfigurationException e) {
-                       throw new MavenEmbedderException(
-                                       "Cannot retrieve default lifecycle phasesConfigurations.",
-                                       e);
-               }
-
-               return phases;
-       }
-
-       // ----------------------------------------------------------------------
-       // Remote Repository
-       // ----------------------------------------------------------------------
-
-       // ----------------------------------------------------------------------
-       // Local Repository
-       // ----------------------------------------------------------------------
-
-       public static final String DEFAULT_LOCAL_REPO_ID = "local";
-
-       public static final String DEFAULT_LAYOUT_ID = "default";
-
-       public ArtifactRepository createLocalRepository(File localRepository)
-                       throws ComponentLookupException {
-               return createLocalRepository(localRepository.getAbsolutePath(),
-                               DEFAULT_LOCAL_REPO_ID);
-       }
-
-       public ArtifactRepository createLocalRepository(Settings settings)
-                       throws ComponentLookupException {
-               return createLocalRepository(settings.getLocalRepository(),
-                               DEFAULT_LOCAL_REPO_ID);
-       }
-
-       public ArtifactRepository createLocalRepository(String url,
-                       String repositoryId) throws ComponentLookupException {
-               if (!url.startsWith("file:")) {
-                       url = "file://" + url;
-               }
-
-               return createRepository(url, repositoryId);
-       }
-
-       public ArtifactRepository createRepository(String url, String repositoryId)
-                       throws ComponentLookupException {
-               // snapshots vs releases
-               // offline = to turning the update policy off
-
-               // TODO: we'll need to allow finer grained creation of repositories but
-               // this will do for now
-
-               String updatePolicyFlag = ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS;
-
-               String checksumPolicyFlag = ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN;
-
-               ArtifactRepositoryPolicy snapshotsPolicy = new ArtifactRepositoryPolicy(
-                               true, updatePolicyFlag, checksumPolicyFlag);
-
-               ArtifactRepositoryPolicy releasesPolicy = new ArtifactRepositoryPolicy(
-                               true, updatePolicyFlag, checksumPolicyFlag);
-
-               return artifactRepositoryFactory.createArtifactRepository(repositoryId,
-                               url, defaultArtifactRepositoryLayout, snapshotsPolicy,
-                               releasesPolicy);
-       }
-
-       // ----------------------------------------------------------------------
-       // Internal utility code
-       // ----------------------------------------------------------------------
-
-       private RuntimeInfo createRuntimeInfo(Settings settings) {
-               RuntimeInfo runtimeInfo = new RuntimeInfo(settings);
-
-               runtimeInfo.setPluginUpdateOverride(Boolean.FALSE);
-
-               return runtimeInfo;
-       }
-
-       private List getPomFiles(File basedir, String[] includes, String[] excludes) {
-               DirectoryScanner scanner = new DirectoryScanner();
-
-               scanner.setBasedir(basedir);
-
-               scanner.setIncludes(includes);
-
-               scanner.setExcludes(excludes);
-
-               scanner.scan();
-
-               List poms = new ArrayList();
-
-               for (int i = 0; i < scanner.getIncludedFiles().length; i++) {
-                       poms.add(new File(basedir, scanner.getIncludedFiles()[i]));
-               }
-
-               return poms;
-       }
-
-       // ----------------------------------------------------------------------
-       // Lifecycle
-       // ----------------------------------------------------------------------
-
-       public void start() throws MavenEmbedderException {
-               detectUserInstallation();
-
-               // ----------------------------------------------------------------------
-               // Set the maven.home system property which is need by components like
-               // the plugin registry builder.
-               // ----------------------------------------------------------------------
-
-               if (classLoader == null) {
-                       throw new IllegalStateException(
-                                       "A classloader must be specified using setClassLoader(ClassLoader).");
-               }
-
-               embedder = new Embedder();
-
-               if (logger != null) {
-                       embedder.setLoggerManager(new MavenEmbedderLoggerManager(
-                                       new PlexusLoggerAdapter(logger)));
-               }
-
-               try {
-                       ClassWorld classWorld = new ClassWorld();
-
-                       classWorld.newRealm("plexus.core", classLoader);
-
-                       embedder.start(classWorld);
-
-                       // ----------------------------------------------------------------------
-                       // Lookup each of the components we need to provide the desired
-                       // client interface.
-                       // ----------------------------------------------------------------------
-
-                       modelReader = new MavenXpp3Reader();
-
-                       modelWriter = new MavenXpp3Writer();
-
-                       pluginDescriptorBuilder = new PluginDescriptorBuilder();
-
-                       profileManager = new DefaultProfileManager(embedder.getContainer());
-
-                       mavenProjectBuilder = (MavenProjectBuilder) embedder
-                                       .lookup(MavenProjectBuilder.ROLE);
-
-                       // ----------------------------------------------------------------------
-                       // Artifact related components
-                       // ----------------------------------------------------------------------
-
-                       artifactRepositoryFactory = (ArtifactRepositoryFactory) embedder
-                                       .lookup(ArtifactRepositoryFactory.ROLE);
-
-                       artifactFactory = (ArtifactFactory) embedder
-                                       .lookup(ArtifactFactory.ROLE);
-
-                       artifactResolver = (ArtifactResolver) embedder
-                                       .lookup(ArtifactResolver.ROLE);
-
-                       defaultArtifactRepositoryLayout = (ArtifactRepositoryLayout) embedder
-                                       .lookup(ArtifactRepositoryLayout.ROLE, DEFAULT_LAYOUT_ID);
-
-                       lifecycleExecutor = (LifecycleExecutor) embedder
-                                       .lookup(LifecycleExecutor.ROLE);
-
-                       wagonManager = (WagonManager) embedder.lookup(WagonManager.ROLE);
-
-                       createMavenSettings();
-
-                       profileManager.loadSettingsProfiles(settings);
-
-                       localRepository = createLocalRepository(settings);
-               } catch (PlexusContainerException e) {
-                       throw new MavenEmbedderException("Cannot start Plexus embedder.", e);
-               } catch (DuplicateRealmException e) {
-                       throw new MavenEmbedderException(
-                                       "Cannot create Classworld realm for the embedder.", e);
-               } catch (ComponentLookupException e) {
-                       throw new MavenEmbedderException(
-                                       "Cannot lookup required component.", e);
-               }
-       }
-
-       // ----------------------------------------------------------------------
-       //
-       // ----------------------------------------------------------------------
-
-       private void detectUserInstallation() {
-               if (new File(userHome, ".m2").exists()) {
-                       alignWithUserInstallation = true;
-               }
-       }
-
-       /**
-        * Create the Settings that will be used with the embedder. If we are
-        * aligning with the user installation then we lookup the standard settings
-        * builder and use that to create our settings. Otherwise we constructs a
-        * settings object and populate the information ourselves.
-        * 
-        * @throws MavenEmbedderException
-        * @throws ComponentLookupException
-        */
-       private void createMavenSettings() throws MavenEmbedderException,
-                       ComponentLookupException {
-               if (alignWithUserInstallation) {
-                       // ----------------------------------------------------------------------
-                       // We will use the standard method for creating the settings. This
-                       // method reproduces the method of building the settings from the
-                       // CLI
-                       // mode of operation.
-                       // ----------------------------------------------------------------------
-
-                       settingsBuilder = (MavenSettingsBuilder) embedder
-                                       .lookup(MavenSettingsBuilder.ROLE);
-
-                       try {
-                               settings = settingsBuilder.buildSettings();
-                       } catch (IOException e) {
-                               throw new MavenEmbedderException("Error creating settings.", e);
-                       } catch (XmlPullParserException e) {
-                               throw new MavenEmbedderException("Error creating settings.", e);
-                       }
-               } else {
-                       if (localRepository == null) {
-                               throw new IllegalArgumentException(
-                                               "When not aligning with a user install you must specify a local repository location using the setLocalRepositoryDirectory( File ) method.");
-                       }
-
-                       settings = new Settings();
-
-                       settings.setLocalRepository(localRepositoryDirectory
-                                       .getAbsolutePath());
-
-                       settings.setRuntimeInfo(createRuntimeInfo(settings));
-
-                       settings.setOffline(offline);
-
-                       settings.setInteractiveMode(interactiveMode);
-               }
-       }
-
-       // ----------------------------------------------------------------------
-       // Lifecycle
-       // ----------------------------------------------------------------------
-
-       public void stop() throws MavenEmbedderException {
-               try {
-                       embedder.release(mavenProjectBuilder);
-
-                       embedder.release(artifactRepositoryFactory);
-
-                       embedder.release(settingsBuilder);
-
-                       embedder.release(lifecycleExecutor);
-               } catch (ComponentLifecycleException e) {
-                       throw new MavenEmbedderException("Cannot stop the embedder.", e);
-               }
-       }
-
-       public Embedder getEmbedder() {
-               return embedder;
-       }
-
-}
diff --git a/runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/AbstractMavenEmbedderLogger.java b/runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/AbstractMavenEmbedderLogger.java
deleted file mode 100644 (file)
index 73a6c2e..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
- *
- * 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.
- */
-
-package org.argeo.slc.maven.embedder;
-
-/*
-* Copyright 2001-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.
-*/
-
-/**
- * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id: AbstractMavenEmbedderLogger.java 292888 2005-10-01 01:17:36Z jvanzyl $
- */
-public abstract class AbstractMavenEmbedderLogger
-        implements MavenEmbedderLogger
-{
-    private int threshold = MavenEmbedderLogger.LEVEL_INFO;
-
-    private String name;
-
-    public int getThreshold()
-    {
-        return threshold;
-    }
-
-    public void setThreshold( int threshold )
-    {
-        this.threshold = threshold;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void debug( String message )
-    {
-        debug( message, null );
-    }
-
-    public boolean isDebugEnabled()
-    {
-        return threshold <= LEVEL_DEBUG;
-    }
-
-    public void info( String message )
-    {
-        info( message, null );
-    }
-
-    public boolean isInfoEnabled()
-    {
-        return threshold <= LEVEL_INFO;
-    }
-
-    public void warn( String message )
-    {
-        warn( message, null );
-    }
-
-    public boolean isWarnEnabled()
-    {
-        return threshold <= LEVEL_WARN;
-    }
-
-    public void error( String message )
-    {
-        error( message, null );
-    }
-
-    public boolean isErrorEnabled()
-    {
-        return threshold <= LEVEL_ERROR;
-    }
-
-    public void fatalError( String message )
-    {
-        fatalError( message, null );
-    }
-
-    public boolean isFatalErrorEnabled()
-    {
-        return threshold <= LEVEL_FATAL;
-    }
-
-    protected boolean isValidThreshold( int threshold )
-    {
-        if ( threshold == LEVEL_DEBUG )
-        {
-            return true;
-        }
-        if ( threshold == LEVEL_INFO )
-        {
-            return true;
-        }
-        if ( threshold == LEVEL_WARN )
-        {
-            return true;
-        }
-        if ( threshold == LEVEL_ERROR )
-        {
-            return true;
-        }
-        if ( threshold == LEVEL_FATAL )
-        {
-            return true;
-        }
-        if ( threshold == LEVEL_DISABLED )
-        {
-            return true;
-        }
-
-        return false;
-    }
-}
diff --git a/runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/MavenEmbedderConsoleLogger.java b/runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/MavenEmbedderConsoleLogger.java
deleted file mode 100644 (file)
index 2a4d286..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
- *
- * 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.
- */
-
-package org.argeo.slc.maven.embedder;
-
-/**
- * Logger sending everything to the standard output streams.
- * This is mainly for the cases when you have a utility that
- * does not have a logger to supply.
- *
- * @author <a href="mailto:dev@avalon.codehaus.org">Avalon Development Team</a>
- * @version $Id: MavenEmbedderConsoleLogger.java 292888 2005-10-01 01:17:36Z jvanzyl $
- */
-public final class MavenEmbedderConsoleLogger
-    extends AbstractMavenEmbedderLogger
-{
-    public void debug( String message, Throwable throwable )
-    {
-        if ( isDebugEnabled() )
-        {
-            System.out.print( "[ maven embedder DEBUG] " );
-            System.out.println( message );
-
-            if ( null != throwable )
-            {
-                throwable.printStackTrace( System.out );
-            }
-        }
-    }
-
-    public void info( String message, Throwable throwable )
-    {
-        if ( isInfoEnabled() )
-        {
-            System.out.print( "[ maven embedder INFO] " );
-            System.out.println( message );
-
-            if ( null != throwable )
-            {
-                throwable.printStackTrace( System.out );
-            }
-        }
-    }
-
-    public void warn( String message, Throwable throwable )
-    {
-        if ( isWarnEnabled() )
-        {
-            System.out.print( "[ maven embedder WARNING] " );
-            System.out.println( message );
-
-            if ( null != throwable )
-            {
-                throwable.printStackTrace( System.out );
-            }
-        }
-    }
-
-    public void error( String message, Throwable throwable )
-    {
-        if ( isErrorEnabled() )
-        {
-            System.out.print( "[ maven embedder ERROR] " );
-            System.out.println( message );
-
-            if ( null != throwable )
-            {
-                throwable.printStackTrace( System.out );
-            }
-        }
-    }
-
-    public void fatalError( String message, Throwable throwable )
-    {
-        if ( isFatalErrorEnabled() )
-        {
-            System.out.print( "[ maven embedder FATAL ERROR] " );
-            System.out.println( message );
-
-            if ( null != throwable )
-            {
-                throwable.printStackTrace( System.out );
-            }
-        }
-    }
-}
diff --git a/runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/MavenEmbedderException.java b/runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/MavenEmbedderException.java
deleted file mode 100644 (file)
index 3231547..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
- *
- * 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.
- */
-
-package org.argeo.slc.maven.embedder;
-
-/*
-* Copyright 2001-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.
-*/
-
-/**
- * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
- * @version $Id:$
- */
-public class MavenEmbedderException
-    extends Exception
-{
-    public MavenEmbedderException( String message )
-    {
-        super( message );
-    }
-
-    public MavenEmbedderException( Throwable cause )
-    {
-        super( cause );
-    }
-
-    public MavenEmbedderException( String message, Throwable cause )
-    {
-        super( message, cause );
-    }
-}
diff --git a/runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/MavenEmbedderLogger.java b/runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/MavenEmbedderLogger.java
deleted file mode 100644 (file)
index 331b215..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
- *
- * 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.
- */
-
-package org.argeo.slc.maven.embedder;
-
-/*
-* Copyright 2001-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.
-*/
-
-/**
- * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
- * @version $Id: MavenEmbedderLogger.java 293410 2005-10-03 18:06:00Z jdcasey $
- */
-public interface MavenEmbedderLogger
-{
-    int LEVEL_DEBUG = 0;
-
-    int LEVEL_INFO = 1;
-
-    int LEVEL_WARN = 2;
-
-    int LEVEL_ERROR = 3;
-
-    int LEVEL_FATAL = 4;
-
-    int LEVEL_DISABLED = 5;
-
-    void debug( String message );
-
-    void debug( String message, Throwable throwable );
-
-    boolean isDebugEnabled();
-
-    void info( String message );
-
-    void info( String message, Throwable throwable );
-
-    boolean isInfoEnabled();
-
-    void warn( String message );
-
-    void warn( String message, Throwable throwable );
-
-    boolean isWarnEnabled();
-
-    void error( String message );
-
-    void error( String message, Throwable throwable );
-
-    boolean isErrorEnabled();
-
-    void fatalError( String message );
-
-    void fatalError( String message, Throwable throwable );
-
-    boolean isFatalErrorEnabled();
-
-    void setThreshold( int threshold );
-
-    int getThreshold();
-}
diff --git a/runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/MavenEmbedderLoggerManager.java b/runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/MavenEmbedderLoggerManager.java
deleted file mode 100644 (file)
index 752175a..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
- *
- * 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.
- */
-
-package org.argeo.slc.maven.embedder;
-
-/*
- * Copyright 2001-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.
- */
-
-import org.codehaus.plexus.logging.AbstractLoggerManager;
-import org.codehaus.plexus.logging.Logger;
-import org.codehaus.plexus.logging.LoggerManager;
-import org.codehaus.plexus.logging.console.ConsoleLogger;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
-
-/**
- * This is a simple logger manager that will only write the logging statements to the console.
- * <p/>
- * Sample configuration:
- * <pre>
- * <logging>
- *   <implementation>org.codehaus.plexus.logging.ConsoleLoggerManager</implementation>
- *   <logger>
- *     <threshold>DEBUG</threshold>
- *   </logger>
- * </logging>
- * </pre>
- *
- * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
- * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id: MavenEmbedderLoggerManager.java 292888 2005-10-01 01:17:36Z jvanzyl $
- */
-public class MavenEmbedderLoggerManager
-    extends AbstractLoggerManager
-    implements LoggerManager, Initializable
-{
-    /**
-     * Message of this level or higher will be logged.
-     * <p/>
-     * This field is set by the plexus container thus the name is 'threshold'. The field
-     * currentThreshold contains the current setting of the threshold.
-     */
-    private String threshold = "info";
-
-    private int currentThreshold;
-
-    private Logger logger;
-
-    public MavenEmbedderLoggerManager( Logger logger )
-    {
-        this.logger = logger;
-    }
-
-    public void initialize()
-    {
-        debug( "Initializing ConsoleLoggerManager: " + this.hashCode() + "." );
-
-        currentThreshold = parseThreshold( threshold );
-
-        if ( currentThreshold == -1 )
-        {
-            debug( "Could not parse the threshold level: '" + threshold + "', setting to debug." );
-            currentThreshold = Logger.LEVEL_DEBUG;
-        }
-    }
-
-    public void setThreshold( int currentThreshold )
-    {
-        this.currentThreshold = currentThreshold;
-    }
-
-    /**
-     * @return Returns the threshold.
-     */
-    public int getThreshold()
-    {
-        return currentThreshold;
-    }
-
-    public void setThreshold( String role, String roleHint, int threshold )
-    {
-    }
-
-    public int getThreshold( String role, String roleHint )
-    {
-        return currentThreshold;
-    }
-
-    public Logger getLoggerForComponent( String role, String roleHint )
-    {
-        return logger;
-    }
-
-    public void returnComponentLogger( String role, String roleHint )
-    {
-    }
-
-    public int getActiveLoggerCount()
-    {
-        return 1;
-    }
-
-    private int parseThreshold( String text )
-    {
-        text = text.trim().toLowerCase();
-
-        if ( text.equals( "debug" ) )
-        {
-            return ConsoleLogger.LEVEL_DEBUG;
-        }
-        else if ( text.equals( "info" ) )
-        {
-            return ConsoleLogger.LEVEL_INFO;
-        }
-        else if ( text.equals( "warn" ) )
-        {
-            return ConsoleLogger.LEVEL_WARN;
-        }
-        else if ( text.equals( "error" ) )
-        {
-            return ConsoleLogger.LEVEL_ERROR;
-        }
-        else if ( text.equals( "fatal" ) )
-        {
-            return ConsoleLogger.LEVEL_FATAL;
-        }
-
-        return -1;
-    }
-
-    /**
-     * Remove this method and all references when this code is verified.
-     *
-     * @param msg
-     */
-    private void debug( String msg )
-    {
-    }
-}
diff --git a/runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/PlexusLoggerAdapter.java b/runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/PlexusLoggerAdapter.java
deleted file mode 100644 (file)
index 75d544b..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
- *
- * 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.
- */
-
-package org.argeo.slc.maven.embedder;
-
-import org.codehaus.plexus.logging.Logger;/*
- * Copyright 2001-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.
- */
-
-/**
- * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
- * @version $Id: PlexusLoggerAdapter.java 293410 2005-10-03 18:06:00Z jdcasey $
- */
-public class PlexusLoggerAdapter
-    implements Logger
-{
-    private MavenEmbedderLogger logger;
-
-    public PlexusLoggerAdapter( MavenEmbedderLogger logger )
-    {
-        this.logger = logger;
-    }
-
-    public void debug( String message )
-    {
-        logger.debug( message );
-    }
-
-    public void debug( String message, Throwable throwable )
-    {
-        logger.debug( message, throwable );
-    }
-
-    public boolean isDebugEnabled()
-    {
-        return logger.isDebugEnabled();
-    }
-
-    public void info( String message )
-    {
-        logger.info( message );
-    }
-
-    public void info( String message, Throwable throwable )
-    {
-        logger.info( message, throwable );
-    }
-
-    public boolean isInfoEnabled()
-    {
-        return logger.isInfoEnabled();
-    }
-
-    public void warn( String message )
-    {
-        logger.warn( message );
-    }
-
-    public void warn( String message, Throwable throwable )
-    {
-        logger.warn( message, throwable );
-    }
-
-    public boolean isWarnEnabled()
-    {
-        return logger.isWarnEnabled();
-    }
-
-    public void error( String message )
-    {
-        logger.error( message );
-    }
-
-    public void error( String message, Throwable throwable )
-    {
-        logger.error( message );
-    }
-
-    public boolean isErrorEnabled()
-    {
-        return logger.isErrorEnabled();
-    }
-
-    public void fatalError( String message )
-    {
-        logger.fatalError( message );
-    }
-
-    public void fatalError( String message, Throwable throwable )
-    {
-        logger.fatalError( message, throwable );
-    }
-
-    public boolean isFatalErrorEnabled()
-    {
-        return logger.isFatalErrorEnabled();
-    }
-
-    public void setThreshold( int i )
-    {
-        logger.setThreshold( i );
-    }
-
-    public int getThreshold()
-    {
-        return logger.getThreshold();
-    }
-
-    public String getName()
-    {
-        return toString();
-    }
-
-    public Logger getChildLogger( String name )
-    {
-        return this;
-    }
-}
diff --git a/runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/SummaryPluginDescriptor.java b/runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/embedder/SummaryPluginDescriptor.java
deleted file mode 100644 (file)
index b86f4b8..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
- *
- * 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.
- */
-
-package org.argeo.slc.maven.embedder;
-
-/**
- * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
- * @version $Id: SummaryPluginDescriptor.java 292750 2005-09-30 14:33:10Z jdcasey $
- */
-public class SummaryPluginDescriptor
-{
-    private String groupId;
-
-    private String artifactId;
-
-    private String name;
-
-    public SummaryPluginDescriptor( String groupId, String artifactId, String name )
-    {
-        this.groupId = groupId;
-        this.artifactId = artifactId;
-        this.name = name;
-    }
-
-    public String getGroupId()
-    {
-        return groupId;
-    }
-
-    public String getArtifactId()
-    {
-        return artifactId;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-}
index 119e71fc64782f675f260363b51f35950aa66b26..e60a79dc41567abd169f11f92f55b97541ea17b0 100644 (file)
@@ -1,4 +1,5 @@
-<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">
+<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>
        <parent>
                <groupId>org.argeo.slc</groupId>
                        <artifactId>org.argeo.slc.core</artifactId>
                </dependency>
 
+               <dependency>
+                       <groupId>org.argeo.dep.osgi</groupId>
+                       <artifactId>org.argeo.dep.osgi.bnd</artifactId>
+               </dependency>
+
                <dependency>
                        <groupId>org.eclipse.osgi</groupId>
                        <artifactId>org.eclipse.osgi</artifactId>
                        <artifactId>com.springsource.org.objectweb.asm.attrs</artifactId>
                </dependency>
 
-               <!--
-                       Xalan and Xerces are implicitly required since the JDK provided
-                       implementations are overridden in the execution modules manager
-               -->
+               <!-- Xalan and Xerces are implicitly required since the JDK provided implementations 
+                       are overridden in the execution modules manager -->
                <dependency>
                        <groupId>org.apache.xalan</groupId>
                        <artifactId>com.springsource.org.apache.xalan</artifactId>
index 036412180032fdfb3d068ef15367347cc06ca749..7430a31e5dc803106d0e4ddb72432ea08fc9e68d 100644 (file)
@@ -3,6 +3,6 @@
        <classpathentry kind="src" output="target/classes" path="src/main/java"/>
        <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry kind="output" path="target/classes"/>
 </classpath>
index 8135e999b84779d78f6483a83273000c7bf6a294..142bb4adac2f48d8944f83f1f292bf7b859c1d54 100644 (file)
                        </arguments>
                </buildCommand>
                <buildCommand>
-                       <name>org.maven.ide.eclipse.maven2Builder</name>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
        </buildSpec>
        <natures>
                <nature>org.eclipse.jdt.core.javanature</nature>
-               <nature>org.maven.ide.eclipse.maven2Nature</nature>
+               <nature>org.eclipse.pde.PluginNature</nature>
        </natures>
 </projectDescription>
index f18a6345b919d316c4a898c83b89b5fa8f7272b5..2f537d0c73ac930bde44a3ccfc128851916ffef1 100644 (file)
@@ -25,6 +25,7 @@
                                                        javax.xml.*;version="0.0.0",
                                                        org.xml.*;version="0.0.0",
                                                        org.springframework.ws.*;resolution:="optional",
+                                                       org.springframework.core;resolution:="optional",
                                                        *
                                                </Import-Package>
                                        </instructions>
@@ -45,7 +46,6 @@
                <dependency>
                        <groupId>org.springframework.ws</groupId>
                        <artifactId>org.springframework.ws</artifactId>
-                       <version>1.5.8.A</version>
                </dependency>
 
                <dependency>