directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r592075 - in /directory/sandbox/felixk/studio-plugin: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/directory/ src/main/java/org/apache/directory/studio/ src/main/java/org/apache/dire...
Date Mon, 05 Nov 2007 16:42:38 GMT
Author: felixk
Date: Mon Nov  5 08:42:37 2007
New Revision: 592075

URL: http://svn.apache.org/viewvc?rev=592075&view=rev
Log:
Initial studio maven-build

Added:
    directory/sandbox/felixk/studio-plugin/   (with props)
    directory/sandbox/felixk/studio-plugin/pom.xml   (with props)
    directory/sandbox/felixk/studio-plugin/src/
    directory/sandbox/felixk/studio-plugin/src/main/
    directory/sandbox/felixk/studio-plugin/src/main/java/
    directory/sandbox/felixk/studio-plugin/src/main/java/org/
    directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/
    directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/
    directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/
    directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/
    directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/
    directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java   (with props)
    directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/ArtifactItem.java   (with props)
    directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioCopyEclipseDependencyMojo.java   (with props)
    directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioReplaceFileInJarMojo.java   (with props)
    directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioUnpackPrefixedMojo.java   (with props)
    directory/sandbox/felixk/studio-plugin/src/site/
    directory/sandbox/felixk/studio-plugin/src/site/apt/
    directory/sandbox/felixk/studio-plugin/src/site/apt/examples/
    directory/sandbox/felixk/studio-plugin/src/site/apt/examples/replace-file-in-jar.apt
    directory/sandbox/felixk/studio-plugin/src/site/apt/examples/unpack-with-prefix.apt
    directory/sandbox/felixk/studio-plugin/src/site/apt/index.apt
    directory/sandbox/felixk/studio-plugin/src/site/apt/usage.apt
    directory/sandbox/felixk/studio-plugin/src/site/fml/
    directory/sandbox/felixk/studio-plugin/src/site/fml/faq.fml
    directory/sandbox/felixk/studio-plugin/src/site/site.xml   (with props)

Propchange: directory/sandbox/felixk/studio-plugin/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Nov  5 08:42:37 2007
@@ -0,0 +1 @@
+target

Added: directory/sandbox/felixk/studio-plugin/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/pom.xml?rev=592075&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-plugin/pom.xml (added)
+++ directory/sandbox/felixk/studio-plugin/pom.xml Mon Nov  5 08:42:37 2007
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+    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.
+-->
+<!--
+    @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+    @version $Id: pom.xml 353 2007-10-28 14:59:35Z felix $
+-->
+
+<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>
+        <artifactId>parent</artifactId>
+        <groupId>org.apache.directory.studio</groupId>
+        <version>1.0.2-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>maven-studio-plugin</artifactId>
+    <packaging>maven-plugin</packaging>
+    <name>Apache Directory Studio Plugin</name>
+
+    <description></description>
+
+    <!-- Set path for local repository -->
+    <properties>
+        <local-repo>${project.basedir}/../local-repository</local-repo>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-artifact</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-plugin-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-project</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-model</artifactId>
+        </dependency>
+    </dependencies>
+
+    <reporting>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-plugin-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </reporting>
+
+</project>
\ No newline at end of file

Propchange: directory/sandbox/felixk/studio-plugin/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java?rev=592075&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java (added)
+++ directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java Mon Nov  5 08:42:37 2007
@@ -0,0 +1,463 @@
+/*
+ *  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.directory.studio.maven.plugins;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+import java.util.zip.ZipOutputStream;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactCollector;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+
+/**
+ * The abstract studio mojo
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Id: AbstractStudioMojo.java 350 2007-10-28 12:01:17Z felix $
+ */
+public abstract class AbstractStudioMojo extends AbstractMojo {
+
+    /**
+     * Location of the file.
+     * 
+     * @parameter expression="${project.build.directory}"
+     * @required
+     * @readonly
+     */
+    protected String buildDirectory;
+
+    /**
+     * Used to look up Artifacts in the remote repository.
+     * 
+     * @parameter expression="${component.org.apache.maven.artifact.factory.ArtifactFactory}"
+     * @required
+     * @readonly
+     */
+    protected org.apache.maven.artifact.factory.ArtifactFactory factory;
+
+    /**
+     * Used to look up Artifacts in the remote repository.
+     * 
+     * @parameter expression="${component.org.apache.maven.artifact.resolver.ArtifactResolver}"
+     * @required
+     * @readonly
+     */
+    protected org.apache.maven.artifact.resolver.ArtifactResolver resolver;
+
+    /**
+     * Collection of ArtifactItems to work on. (ArtifactItem contains groupId,
+     * artifactId, version, type, classifier, location, destFile, markerFile and
+     * overwrite.) See "Usage" and "Javadoc" for details.
+     * 
+     * @parameter
+     * @required
+     */
+    protected ArrayList<ArtifactItem> artifactItems;
+
+    /**
+     * Artifact collector, needed to resolve dependencies.
+     * 
+     * @component role="org.apache.maven.artifact.resolver.ArtifactCollector"
+     * @required
+     * @readonly
+     */
+    protected ArtifactCollector artifactCollector;
+
+    /**
+     * @component role="org.apache.maven.artifact.metadata.ArtifactMetadataSource"
+     *            hint="maven"
+     * @required
+     * @readonly
+     */
+    protected ArtifactMetadataSource artifactMetadataSource;
+
+    /**
+     * Location of the local repository.
+     * 
+     * @parameter expression="${localRepository}"
+     * @readonly
+     * @required
+     */
+    protected org.apache.maven.artifact.repository.ArtifactRepository local;
+
+    /**
+     * List of Remote Repositories used by the resolver
+     * 
+     * @parameter expression="${project.remoteArtifactRepositories}"
+     * @readonly
+     * @required
+     */
+    protected List<ArtifactRepository> remoteRepos;
+
+    /**
+     * POM
+     * 
+     * @parameter expression="${project}"
+     * @readonly
+     * @required
+     */
+    protected MavenProject project;
+
+    /**
+     * Output absolute filename for resolved artifacts
+     * 
+     * @optional
+     * @since 2.0
+     * @parameter expression="${outputAbsoluteArtifactFilename}"
+     *            default-value="false"
+     */
+    protected boolean outputAbsoluteArtifactFilename;
+
+    /**
+     * Unzip a file into a directory
+     * 
+     * @param unzipDir
+     *            The directory the file unzip into
+     * @param zipFile
+     *            The file to unzip
+     */
+    protected void unzipToDir(final File unzipDir, final File zipFile) throws Exception {
+        final ZipFile zf = new ZipFile(zipFile);
+
+        try {
+            final Enumeration<? extends ZipEntry> zipEnum = zf.entries();
+            while (zipEnum.hasMoreElements()) {
+                final ZipEntry item = zipEnum.nextElement();
+
+                if (item.isDirectory()) {
+                    final File newdir = new File(unzipDir.getAbsoluteFile() + File.separator + item.getName());
+                    newdir.mkdirs();
+                } else {
+                    final String newfile = unzipDir.getAbsoluteFile() + File.separator + item.getName();
+                    final InputStream is = zf.getInputStream(item);
+                    final FileOutputStream fos = new FileOutputStream(newfile);
+                    try {
+                        int ch;
+                        while ((ch = is.read()) != -1) {
+                            fos.write(ch);
+                        }
+                    } finally {
+                        is.close();
+                        fos.flush();
+                        fos.close();
+                    }
+                }
+            }
+        } finally {
+            zf.close();
+        }
+    }
+
+    /**
+     * Zip a directory to given ZipOutputStream
+     * 
+     * @param dirToZip
+     *            A directory to zip
+     * @param zos
+     *            The A ZipOutputStream
+     * @throws Exception
+     *             If an error occurs
+     */
+    protected void zipFromDir(final File dirToZip, final File zipFile) throws Exception {
+        final ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile));
+        try {
+            if (!dirToZip.isFile() && !dirToZip.isDirectory()) {
+                throw new MojoExecutionException("Source file/directory " + dirToZip.getAbsolutePath() + " not found.");
+            }
+            zipFiles(dirToZip, zos, dirToZip.getAbsolutePath());
+        } finally {
+            zos.finish();
+            zos.close();
+        }
+    }
+
+    private void zipFiles(File cpFile, ZipOutputStream zos, final String dirToZip) throws Exception {
+        int byteCount;
+        final int DATA_BLOCK_SIZE = 2048;
+
+        if (cpFile.isDirectory()) {
+            File[] fList = cpFile.listFiles();
+            for (File aFile : fList) {
+                zipFiles(aFile, zos, dirToZip);
+            }
+        } else {
+            String strAbsPath = cpFile.getPath();
+            String strZipEntryName = strAbsPath.substring(dirToZip.length() + 1, strAbsPath.length());
+
+            final FileInputStream cpFileInputStream = new FileInputStream(cpFile);
+            try {
+                ZipEntry cpZipEntry = new ZipEntry(strZipEntryName);
+                zos.putNextEntry(cpZipEntry);
+
+                final byte[] b = new byte[DATA_BLOCK_SIZE];
+                while ((byteCount = cpFileInputStream.read(b, 0, DATA_BLOCK_SIZE)) != -1) {
+                    zos.write(b, 0, byteCount);
+                }
+                zos.closeEntry();
+            } finally {
+                cpFileInputStream.close();
+            }
+        }
+    }
+
+    /**
+     * Resolves the Artifact from the remote repository if nessessary. If no
+     * version is specified, it will be retrieved from the dependency list or
+     * from the DependencyManagement section of the pom.
+     * 
+     * @param artifactItem
+     *            containing information about artifact from plugin
+     *            configuration.
+     * @return Artifact object representing the specified file.
+     * 
+     * @throws MojoExecutionException
+     *             with a message if the version can't be found in
+     *             DependencyManagement.
+     */
+    protected Artifact getArtifact(ArtifactItem artifactItem) throws MojoExecutionException {
+        Artifact artifact;
+
+        VersionRange vr;
+        try {
+            vr = VersionRange.createFromVersionSpec(artifactItem.getVersion());
+        } catch (InvalidVersionSpecificationException e1) {
+            e1.printStackTrace();
+            vr = VersionRange.createFromVersion(artifactItem.getVersion());
+        }
+
+        if (StringUtils.isEmpty(artifactItem.getClassifier())) {
+            artifact = factory.createDependencyArtifact(artifactItem.getGroupId(), artifactItem.getArtifactId(), vr,
+                    artifactItem.getType(), null, Artifact.SCOPE_COMPILE);
+        } else {
+            artifact = factory.createDependencyArtifact(artifactItem.getGroupId(), artifactItem.getArtifactId(), vr,
+                    artifactItem.getType(), artifactItem.getClassifier(), Artifact.SCOPE_COMPILE);
+        }
+
+        try {
+            resolver.resolve(artifact, remoteRepos, local);
+        } catch (ArtifactResolutionException e) {
+            throw new MojoExecutionException("Unable to resolve artifact.", e);
+        } catch (ArtifactNotFoundException e) {
+            throw new MojoExecutionException("Unable to find artifact.", e);
+        }
+
+        return artifact;
+    }
+
+    /**
+     * Tries to find missing version from dependancy list and dependency
+     * management. If found, the artifact is updated with the correct version.
+     * 
+     * It will first look for an exact match on
+     * artifactId/groupId/classifier/type and if it doesn't find a match, it
+     * will try again looking for artifactId and groupId only.
+     * 
+     * @param artifact
+     *            representing configured file.
+     * @throws MojoExecutionException
+     */
+    protected void fillMissingArtifactVersion(ArtifactItem artifact) throws MojoExecutionException {
+        if (!findDependencyVersion(artifact, project.getDependencies(), false)
+                && (project.getDependencyManagement() == null || !findDependencyVersion(artifact, project
+                        .getDependencyManagement().getDependencies(), false))
+                && !findDependencyVersion(artifact, project.getDependencies(), true)
+                && (project.getDependencyManagement() == null || !findDependencyVersion(artifact, project
+                        .getDependencyManagement().getDependencies(), true))) {
+            throw new MojoExecutionException("Unable to find artifact version of " + artifact.getGroupId() + ":"
+                    + artifact.getArtifactId() + " in either dependency list or in project's dependency management.");
+        }
+    }
+
+    /**
+     * Tries to find missing version from a list of dependencies. If found, the
+     * artifact is updated with the correct version.
+     * 
+     * @param artifact
+     *            representing configured file.
+     * @param list
+     *            list of dependencies to search.
+     * @param looseMatch
+     *            only look at artifactId and groupId
+     * @return the found dependency
+     */
+    protected boolean findDependencyVersion(ArtifactItem artifact, List<Dependency> list, boolean looseMatch) {
+        boolean result = false;
+
+        for (int i = 0; i < list.size(); i++) {
+            Dependency dependency = list.get(i);
+            if (StringUtils.equals(dependency.getArtifactId(), artifact.getArtifactId())
+                    && StringUtils.equals(dependency.getGroupId(), artifact.getGroupId())
+                    && (looseMatch || StringUtils.equals(dependency.getClassifier(), artifact.getClassifier()))
+                    && (looseMatch || StringUtils.equals(dependency.getType(), artifact.getType()))) {
+
+                artifact.setVersion(dependency.getVersion());
+                result = true;
+                break;
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Complete the artifacts in the artifactItems list (e.g. complete with
+     * version number)
+     * 
+     * @throws MojoExecutionException
+     */
+    protected void completeArtifactItems() throws MojoExecutionException {
+        try {
+            // Get and complete artifacts
+            for (Iterator<ArtifactItem> artifactItem = artifactItems.iterator(); artifactItem.hasNext();) {
+                ArtifactItem item = artifactItem.next();
+                // make sure we have a version.
+                if (StringUtils.isEmpty(item.getVersion())) {
+                    fillMissingArtifactVersion(item);
+                }
+                item.setArtifact(this.getArtifact(item));
+            }
+        } catch (Exception e) {
+            throw new MojoExecutionException("", e);
+        }
+    }
+
+    /**
+     * @param artifactItems
+     *            the artifactItems to set
+     */
+    public void setArtifactItems(ArrayList<ArtifactItem> artifactItems) {
+        this.artifactItems = artifactItems;
+    }
+
+    /**
+     * @return Returns the factory.
+     */
+    public org.apache.maven.artifact.factory.ArtifactFactory getFactory() {
+        return this.factory;
+    }
+
+    /**
+     * @param factory
+     *            The factory to set.
+     */
+    public void setFactory(org.apache.maven.artifact.factory.ArtifactFactory factory) {
+        this.factory = factory;
+    }
+
+    /**
+     * @return Returns the project.
+     */
+    public MavenProject getProject() {
+        return this.project;
+    }
+
+    /**
+     * @return Returns the local.
+     */
+    public org.apache.maven.artifact.repository.ArtifactRepository getLocal() {
+        return this.local;
+    }
+
+    /**
+     * @param local
+     *            The local to set.
+     */
+    public void setLocal(org.apache.maven.artifact.repository.ArtifactRepository local) {
+        this.local = local;
+    }
+
+    /**
+     * @return Returns the remoteRepos.
+     */
+    public List<ArtifactRepository> getRemoteRepos() {
+        return this.remoteRepos;
+    }
+
+    /**
+     * @param remoteRepos
+     *            The remoteRepos to set.
+     */
+    public void setRemoteRepos(List<ArtifactRepository> remoteRepos) {
+        this.remoteRepos = remoteRepos;
+    }
+
+    /**
+     * @return Returns the resolver.
+     */
+    public org.apache.maven.artifact.resolver.ArtifactResolver getResolver() {
+        return this.resolver;
+    }
+
+    /**
+     * @param resolver
+     *            The resolver to set.
+     */
+    public void setResolver(org.apache.maven.artifact.resolver.ArtifactResolver resolver) {
+        this.resolver = resolver;
+    }
+
+    /**
+     * @return Returns the artifactCollector.
+     */
+    public ArtifactCollector getArtifactCollector() {
+        return this.artifactCollector;
+    }
+
+    /**
+     * @param theArtifactCollector
+     *            The artifactCollector to set.
+     */
+    public void setArtifactCollector(ArtifactCollector theArtifactCollector) {
+        this.artifactCollector = theArtifactCollector;
+    }
+
+    /**
+     * @return Returns the artifactMetadataSource.
+     */
+    public ArtifactMetadataSource getArtifactMetadataSource() {
+        return this.artifactMetadataSource;
+    }
+
+    /**
+     * @param theArtifactMetadataSource
+     *            The artifactMetadataSource to set.
+     */
+    public void setArtifactMetadataSource(ArtifactMetadataSource theArtifactMetadataSource) {
+        this.artifactMetadataSource = theArtifactMetadataSource;
+    }
+}
\ No newline at end of file

Propchange: directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/ArtifactItem.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/ArtifactItem.java?rev=592075&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/ArtifactItem.java (added)
+++ directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/ArtifactItem.java Mon Nov  5 08:42:37 2007
@@ -0,0 +1,196 @@
+/*
+ *  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.directory.studio.maven.plugins;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.maven.artifact.Artifact;
+
+/**
+ * ArtifactItem represents information specified in the plugin configuration
+ * section for each artifact.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Id: ArtifactItem.java 349 2007-10-28 11:51:21Z felix $
+ */
+public class ArtifactItem {
+    /**
+     * Group Id of Artifact
+     * 
+     * @parameter
+     * @required
+     */
+    private String groupId;
+
+    /**
+     * Name of Artifact
+     * 
+     * @parameter
+     * @required
+     */
+    private String artifactId;
+
+    /**
+     * Version of Artifact
+     * 
+     * @parameter
+     */
+    private String version = null;
+
+    /**
+     * Type of Artifact (War,Jar,etc)
+     * 
+     * @parameter
+     * @required
+     */
+    private String type = "jar";
+
+    /**
+     * Classifier for Artifact (tests,sources,etc)
+     * 
+     * @parameter
+     */
+    private String classifier;
+
+    /**
+     * Artifact Item
+     */
+    private Artifact artifact;
+
+    public ArtifactItem() {
+        // default constructor
+    }
+
+    public ArtifactItem(Artifact artifact) {
+        this.setArtifact(artifact);
+        this.setArtifactId(artifact.getArtifactId());
+        this.setClassifier(artifact.getClassifier());
+        this.setGroupId(artifact.getGroupId());
+        this.setType(artifact.getType());
+        this.setVersion(artifact.getVersion());
+    }
+
+    private String filterEmptyString(String in) {
+        if (in == null || in.equals("")) {
+            return null;
+        } else {
+            return in;
+        }
+    }
+
+    /**
+     * @return Returns the artifactId.
+     */
+    public String getArtifactId() {
+        return artifactId;
+    }
+
+    /**
+     * @param artifactId
+     *            The artifactId to set.
+     */
+    public void setArtifactId(String artifact) {
+        this.artifactId = filterEmptyString(artifact);
+    }
+
+    /**
+     * @return Returns the groupId.
+     */
+    public String getGroupId() {
+        return groupId;
+    }
+
+    /**
+     * @param groupId
+     *            The groupId to set.
+     */
+    public void setGroupId(String groupId) {
+        this.groupId = filterEmptyString(groupId);
+    }
+
+    /**
+     * @return Returns the type.
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * @param type
+     *            The type to set.
+     */
+    public void setType(String type) {
+        this.type = filterEmptyString(type);
+    }
+
+    /**
+     * @return Returns the version.
+     */
+    public String getVersion() {
+        return version;
+    }
+
+    /**
+     * @param version
+     *            The version to set.
+     */
+    public void setVersion(String version) {
+        this.version = filterEmptyString(version);
+    }
+
+    /**
+     * @return Classifier.
+     */
+    public String getClassifier() {
+        return classifier;
+    }
+
+    /**
+     * @param classifier
+     *            Classifier.
+     */
+    public void setClassifier(String classifier) {
+        this.classifier = filterEmptyString(classifier);
+    }
+
+    public String toString() {
+        if (this.classifier == null) {
+            return groupId + ":" + artifactId + ":" + StringUtils.defaultString(version, "?") + ":" + type;
+        } else {
+            return groupId + ":" + artifactId + ":" + classifier + ":" + StringUtils.defaultString(version, "?") + ":"
+                    + type;
+        }
+    }
+
+    /**
+     * @return Returns the artifact.
+     */
+    public Artifact getArtifact() {
+        return this.artifact;
+    }
+
+    /**
+     * @param artifact
+     *            The artifact to set.
+     */
+    public void setArtifact(Artifact artifact) {
+        this.artifact = artifact;
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/ArtifactItem.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioCopyEclipseDependencyMojo.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioCopyEclipseDependencyMojo.java?rev=592075&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioCopyEclipseDependencyMojo.java (added)
+++ directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioCopyEclipseDependencyMojo.java Mon Nov  5 08:42:37 2007
@@ -0,0 +1,83 @@
+/*
+ *  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.directory.studio.maven.plugins;
+
+import java.io.File;
+import java.util.Iterator;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * Copy a set of artifacts to a configured output directory by replacing the
+ * separator between artifactId and version by an underscore instead of a dash.
+ * 
+ * @goal copy-eclipse-artifact
+ * @description Replace the separator between artifactId and version by an
+ *              underscore instead of a dash and copy the artifact to a given
+ *              destination directory
+ * @requiresProject
+ * @requiresDependencyResolution runtime
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Id: StudioReplaceFileInJarMojo.java 350 2007-10-28 12:01:17Z felix $
+ */
+public class StudioCopyEclipseDependencyMojo extends AbstractStudioMojo {
+
+    /**
+     * Location of the file.
+     * 
+     * @parameter expression="${project.build.directory}"
+     * @required
+     */
+    private File destinationDirectory;
+
+    /**
+     * @param destinationDirectory
+     *            the destinationDirectory to set
+     */
+    public void setDestinationDirectory(File destinationDirectory) {
+        this.destinationDirectory = destinationDirectory;
+    }
+
+    public void execute() throws MojoExecutionException {
+
+        completeArtifactItems();
+
+        for (Iterator<ArtifactItem> artifactItem = artifactItems.iterator(); artifactItem.hasNext();) {
+            ArtifactItem item = artifactItem.next();
+            try {
+
+                final File destFile = new File(destinationDirectory.getAbsoluteFile() + File.separator
+                        + item.getArtifactId() + "_" + item.getVersion() + "." + item.getType());
+
+                getLog().info("Copying " + item.getArtifactId() + " to " + destFile.getAbsolutePath());
+
+                if (!destinationDirectory.exists()) {
+                    destinationDirectory.mkdirs();
+                }
+                FileUtils.copyFile(item.getArtifact().getFile(), destFile);
+
+            } catch (Exception e) {
+                throw new MojoExecutionException("", e);
+            }
+        }
+    }
+}

Propchange: directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioCopyEclipseDependencyMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioReplaceFileInJarMojo.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioReplaceFileInJarMojo.java?rev=592075&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioReplaceFileInJarMojo.java (added)
+++ directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioReplaceFileInJarMojo.java Mon Nov  5 08:42:37 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.directory.studio.maven.plugins;
+
+import java.io.File;
+import java.util.Iterator;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * Add ro replace file in existing, distributed artifact
+ * 
+ * @goal replace-file-in-eclipse-artifact
+ * @description Add/Replace a file within a given eclipse artifact at a specific
+ *              location (zip or jar file)
+ * @phase package
+ * @requiresProject
+ * @requiresDependencyResolution runtime
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Id: StudioReplaceFileInJarMojo.java 368 2007-11-02 06:52:32Z felix $
+ */
+public class StudioReplaceFileInJarMojo extends AbstractStudioMojo {
+
+    /**
+     * FinalName of the jar file
+     * 
+     * @parameter
+     * @required
+     */
+    private File inputFile;
+
+    /**
+     * Location of the file.
+     * 
+     * @parameter expression="${project.build.directory}"
+     * @required
+     */
+    private File destinationDirectory;
+
+    /**
+     * Tmp work directory for this plugin
+     * 
+     * @parameter expression="${project.build.directory}/ReplaceFileInJarMojo/"
+     * @required
+     * @readonly
+     */
+    private String pluginWorkDir;
+
+    /**
+     * @param destinationDirectory
+     *            the destinationDirectory to set
+     */
+    public void setDestinationDirectory(File destinationDirectory) {
+        this.destinationDirectory = destinationDirectory;
+    }
+
+    /**
+     * @param inputFile
+     *            the inputFile to set
+     */
+    public void setInputFile(File inputFile) {
+        this.inputFile = inputFile;
+    }
+
+    public void execute() throws MojoExecutionException {
+
+        completeArtifactItems();
+
+        // Add file to dest jar
+        for (Iterator<ArtifactItem> artifactItem = artifactItems.iterator(); artifactItem.hasNext();) {
+            ArtifactItem item = artifactItem.next();
+            try {
+                final File zipFile = new File(destinationDirectory.getAbsolutePath() + File.separator
+                        + item.getArtifactId() + "_" + item.getVersion() + "." + item.getType());
+                final File tmpDir = new File(pluginWorkDir + item.getArtifact().getArtifactId());
+
+                getLog().info("Adding " + inputFile + " to " + zipFile);
+
+                if (getLog().isDebugEnabled())
+                    getLog().debug("Unzipping " + zipFile + " into " + tmpDir);
+                unzipToDir(tmpDir, zipFile);
+
+                if (getLog().isDebugEnabled())
+                    getLog().debug("Copying " + inputFile + " into " + tmpDir);
+                FileUtils.copyFileToDirectory(inputFile, tmpDir);
+
+                if (getLog().isDebugEnabled())
+                    getLog().debug("Zipping " + tmpDir + " into " + zipFile);
+                zipFromDir(tmpDir, zipFile);
+
+            } catch (Exception e) {
+                throw new MojoExecutionException("", e);
+            }
+        }
+    }
+}

Propchange: directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioReplaceFileInJarMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioUnpackPrefixedMojo.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioUnpackPrefixedMojo.java?rev=592075&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioUnpackPrefixedMojo.java (added)
+++ directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioUnpackPrefixedMojo.java Mon Nov  5 08:42:37 2007
@@ -0,0 +1,79 @@
+/*
+ *  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.directory.studio.maven.plugins;
+
+import java.io.File;
+import java.util.Iterator;
+
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * Prefixes the unpack of an artifact into a given directory with a directory
+ * named based on the artifacts final name
+ * 
+ * @goal unpack-with-artifactid-prefix
+ * @description Prefixes the unpack of an artifact into a given directory with a
+ *              directory named based on the artifacts final name
+ * @phase package
+ * @requiresProject
+ * @requiresDependencyResolution runtime
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Id: StreamGenerator.java 448473 2006-09-21 06:22:51Z crossley $
+ */
+public class StudioUnpackPrefixedMojo extends AbstractStudioMojo {
+
+    /**
+     * Location of the file.
+     * 
+     * @parameter expression="${project.build.directory}"
+     * @required
+     */
+    private File outputDirectory;
+
+    /**
+     * @param outputDirectory
+     *            the outputDirectory to set
+     */
+    public void setOutputDirectory(File outputDirectory) {
+        this.outputDirectory = outputDirectory;
+    }
+
+    public void execute() throws MojoExecutionException {
+
+        completeArtifactItems();
+
+        // unzip it
+        for (Iterator<ArtifactItem> artifactItem = artifactItems.iterator(); artifactItem.hasNext();) {
+            ArtifactItem item = artifactItem.next();
+            try {
+                final File tmpDir = new File(outputDirectory.getAbsoluteFile() + File.separator + item.getArtifactId()
+                        + "_" + item.getVersion());
+
+                if (getLog().isDebugEnabled())
+                    getLog().debug("Unzipping " + item.getArtifact().getFile() + " into " + tmpDir);
+                unzipToDir(tmpDir, item.getArtifact().getFile());
+
+            } catch (Exception e) {
+                throw new MojoExecutionException("", e);
+            }
+        }
+    }
+}

Propchange: directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioUnpackPrefixedMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-plugin/src/site/apt/examples/replace-file-in-jar.apt
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/src/site/apt/examples/replace-file-in-jar.apt?rev=592075&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-plugin/src/site/apt/examples/replace-file-in-jar.apt (added)
+++ directory/sandbox/felixk/studio-plugin/src/site/apt/examples/replace-file-in-jar.apt Mon Nov  5 08:42:37 2007
@@ -0,0 +1,64 @@
+~~ 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.    
+ 
+  ------
+  Add or replace a file to existing, distributed artifact
+  ------
+  Felix Knecht
+  ------
+  Oct 2007
+  ------
+
+Add or replace a file to existing, distributed artifact
+
+  Adds or replaces a file in an existing, distributed artifact.
+
++---+
+<project>
+  [...]
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.directory.studio</groupId>
+        <artifactId>maven-studio-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>replace-plugin.xml-in-org.eclipse.search</id>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>replace-file-in-jar</goal>
+            </goals>
+            <configuration>
+              <inputFile>src/main/configuration/org.eclipse.search/plugin.xml</inputFile>
+              <destinationDirectory>${studio-dir}/plugins</destinationDirectory>
+              <overWrite>false</overWrite>
+              <outputDirectory>target/eclipse/plugins</outputDirectory>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>org.eclipse</groupId>
+                  <artifactId>org.eclipse.search</artifactId>
+                </artifactItem>
+              </artifactItems>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  [...]
+</project>
++---+

Added: directory/sandbox/felixk/studio-plugin/src/site/apt/examples/unpack-with-prefix.apt
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/src/site/apt/examples/unpack-with-prefix.apt?rev=592075&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-plugin/src/site/apt/examples/unpack-with-prefix.apt (added)
+++ directory/sandbox/felixk/studio-plugin/src/site/apt/examples/unpack-with-prefix.apt Mon Nov  5 08:42:37 2007
@@ -0,0 +1,66 @@
+~~ 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.    
+ 
+  ------
+  Unpack with prefix
+  ------
+  Felix Knecht
+  ------
+  Oct 2007
+  ------
+
+Unpack with prefix
+
+  Unpack an artifact in a desired location and put the artifact content into a directory
+  named like the final artifacts name (This is mainly used to unpack a *-feature.jar).
+
++---+
+<project>
+  [...]
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.directory.studio</groupId>
+        <artifactId>maven-studio-plugin</artifactId>
+        <executions>
+        <executions>
+          <execution>
+            <id>unpack-with-artifactid-prefix</id>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>unpack-with-artifactid-prefix</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>target/features</outputDirectory>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>org.apache.directory.studio</groupId>
+                  <artifactId>${pom.groupId}.feature</artifactId>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>org.apache.directory.studio</groupId>
+                  <artifactId>${pom.groupId}.schemaeditor.feature</artifactId>
+                </artifactItem>
+              </artifactItems>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  [...]
+</project>
++---+

Added: directory/sandbox/felixk/studio-plugin/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/src/site/apt/index.apt?rev=592075&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-plugin/src/site/apt/index.apt (added)
+++ directory/sandbox/felixk/studio-plugin/src/site/apt/index.apt Mon Nov  5 08:42:37 2007
@@ -0,0 +1,59 @@
+~~ 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.    
+ 
+  ------
+  Introduction
+  ------
+  Felix Knecht
+  ------
+  Oct 2007
+  ------
+
+Directory Studio Maven Plugin
+
+  The directory studio maven plugin provides the capability to manipulate artifacts. It
+  can prefix existing jar content with a director or can replace/add a file within an existing
+  zip/jar archive.
+
+* Goals Overview
+
+  The directory studio maven plugin has 2 goals:
+  
+  *{{{replace-mojo.html}studio:replace-file-in-jar}} takes a list of artifacts defined in
+  the plugin configuration section and a configured directory where the artifacts
+  are located (not in the local maven repository, but after a being copied e.g. to target
+  directory) and replaced/adds a desired file to them.
+
+  *{{{prefix-mojo.html}studio:unpack-with-artifactid-prefix}} unpack an artifact in a desired location and put
+  the artifact content into a directory named like the final artifacts name (This is mainly used
+  to unpack a *-feature.jar).
+
+  []
+  
+* Usage
+
+   * Instructions on how to use the dependency plugin can be found {{{usage.html}here}}.
+
+  []
+
+* Examples
+
+  The following examples show how to use the directory studio maven plugin in more advanced use-cases:
+  
+  * {{{examples/replace-file-in-jar.html}replace/update a file in jar artifacts at a given location}}.
+
+  * {{{examples/unpack-with-prefix.html}Unpack artifact content into prefixed destination}}

Added: directory/sandbox/felixk/studio-plugin/src/site/apt/usage.apt
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/src/site/apt/usage.apt?rev=592075&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-plugin/src/site/apt/usage.apt (added)
+++ directory/sandbox/felixk/studio-plugin/src/site/apt/usage.apt Mon Nov  5 08:42:37 2007
@@ -0,0 +1,112 @@
+~~ 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.    
+ 
+  ------
+  Usage
+  ------
+  Felix Knecht
+  ------
+  Oct 2007
+  ------
+
+Usage
+ 
+  Brief examples on how to use the dependency goals.
+ 
+* Generic Plugin configuration information
+
+  See the following links for information about including and configuring plugins in your project:
+  
+  *{{{http://maven.apache.org/guides/mini/guide-configuring-plugins.html}Configuring Plugins}}
+  
+  *{{{http://maven.apache.org/guides/plugin/guide-java-plugin-development.html}Plugin Development}}
+
+  *{{{http://maven.apache.org/guides/introduction/introduction-to-plugin-prefix-mapping.html}Plugin Prefix}}
+
+* The <<<studio:prefix-jar-content>>> mojo
+
+Prefix built jar
+
+  Prefixes the content of the built jar with its artifact name 
+  (normally used to build extractable studio-*-feature.jar).
+
++---+
+<project>
+  [...]
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.directory.studio</groupId>
+        <artifactId>maven-studio-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>prefix-jar-content</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  [...]
+</project>
++---+
+  
+* The <<<studio:replace-file-in-jar>>> mojo
+
+Add or replace a file to existing, distributed artifact
+
+  Adds or replaces a file in an existing, distributed artifact.
+
++---+
+<project>
+  [...]
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.directory.studio</groupId>
+        <artifactId>maven-studio-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>replace-plugin.xml-in-org.eclipse.search</id>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>replace-file-in-jar</goal>
+            </goals>
+            <configuration>
+              <inputFile>src/main/configuration/org.eclipse.search/plugin.xml</inputFile>
+              <destinationDirectory>${studio-dir}/plugins</destinationDirectory>
+              <overWrite>false</overWrite>
+              <outputDirectory>target/eclipse/plugins</outputDirectory>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>org.eclipse</groupId>
+                  <artifactId>org.eclipse.search</artifactId>
+                </artifactItem>
+              </artifactItems>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  [...]
+</project>
++---+
+  
+  
+  

Added: directory/sandbox/felixk/studio-plugin/src/site/fml/faq.fml
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/src/site/fml/faq.fml?rev=592075&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-plugin/src/site/fml/faq.fml (added)
+++ directory/sandbox/felixk/studio-plugin/src/site/fml/faq.fml Mon Nov  5 08:42:37 2007
@@ -0,0 +1,62 @@
+<?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.
+-->
+<!--
+    @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+    @version $Id: pom.xml 353 2007-10-28 14:59:35Z felix $
+-->
+
+<faqs id="FAQ" title="Frequently Asked Questions">
+<part id="general">
+    <title>General</title>
+   
+    <faq id="whats-foo">
+      <question>
+        What is Foo?
+      </question>
+      <answer>
+        <p>some markup goes here</p>
+        
+        <source>some source code</source>
+        
+        <p>some markup goes here</p>
+      </answer>
+    </faq>
+
+    <faq id="whats-bar">
+      <question>
+        What is Bar?
+      </question>
+      <answer>
+        <p>some markup goes here</p>
+      </answer>
+    </faq>
+  </part>
+  
+  <part id="install">
+    <title>Installation</title>
+   
+    <faq id="how-install">
+      <question>
+        How do I install Foo?
+      </question>
+      <answer>
+        <p>some markup goes here</p>
+      </answer>
+    </faq>
+  </part>  
+</faqs>

Added: directory/sandbox/felixk/studio-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/src/site/site.xml?rev=592075&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-plugin/src/site/site.xml (added)
+++ directory/sandbox/felixk/studio-plugin/src/site/site.xml Mon Nov  5 08:42:37 2007
@@ -0,0 +1,37 @@
+<?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.
+-->
+<!--
+    @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+    @version $Id: pom.xml 353 2007-10-28 14:59:35Z felix $
+-->
+
+<project>
+    <body>
+        <menu name="Overview">
+            <item name="Introduction" href="index.html" />
+            <item name="Goals" href="plugin-info.html" />
+            <item name="Usage" href="usage.html" />
+            <item name="FAQ" href="faq.html" />
+        </menu>
+        <menu name="Examples">
+            <item name="Unpack with prefix" href="examples/unpack-with-prefix.html" />
+            <item name="Add/replace file in distributed artifact" href="examples/replace-file-in-jar.html" />
+        </menu>
+        <menu ref="reports" />
+    </body>
+</project>
\ No newline at end of file

Propchange: directory/sandbox/felixk/studio-plugin/src/site/site.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message