You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrf-dev@ws.apache.org by ip...@apache.org on 2004/12/14 19:28:55 UTC

svn commit: r111851 - in incubator/apollo/trunk: . maven-plugins maven-plugins/maven-ajar-plugin maven-plugins/maven-ajar-plugin/src maven-plugins/maven-ajar-plugin/src/java maven-plugins/maven-intellij-plugin maven-plugins/maven-intellij-plugin/src src/java/org/apache/ws/resource/i18n

Author: ips
Date: Tue Dec 14 10:28:53 2004
New Revision: 111851

URL: http://svn.apache.org/viewcvs?view=rev&rev=111851
Log:
Maven plugins

Added:
   incubator/apollo/trunk/maven-plugins/
   incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/
   incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/plugin.jelly
   incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/plugin.properties
   incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/project.properties
   incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/project.xml
   incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/src/
   incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/src/java/
   incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/src/java/DependencyRetriever.java
   incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/
   incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/maven-intellij-plugin-readme.txt
   incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/plugin.jelly
   incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/plugin.properties
   incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/project.xml
   incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/src/
   incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/src/MavenIdeaImlUpdater.java
Modified:
   incubator/apollo/trunk/project.xml
   incubator/apollo/trunk/src/java/org/apache/ws/resource/i18n/Keys.java

Added: incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/plugin.jelly
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/plugin.jelly?view=auto&rev=111851
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/plugin.jelly	Tue Dec 14 10:28:53 2004
@@ -0,0 +1,97 @@
+<?xml version="1.0"?>
+
+<project
+   xmlns:j="jelly:core"
+   xmlns:u="jelly:util"
+   xmlns:define="jelly:define"
+   xmlns:c="jstl:core"
+   xmlns:ajar="ajar">
+
+   <define:taglib uri="ajar">
+      <define:jellybean name="update" className="DependencyRetriever" method="update"/>
+   </define:taglib>
+
+   <!-- ================================================================== -->
+   <!-- A J A R : U P D A T E                                              -->
+   <!-- ================================================================== -->
+   <goal name="ajar:update" prereqs="ajar:update-src, ajar:update-api"/>
+
+   <!-- ================================================================== -->
+   <!-- A J A R : U P D A T E - S R C                                      -->
+   <!-- ================================================================== -->
+   <goal name="ajar:update-src">
+
+      <j:if test="${context.getVariable('maven.ajar.src.enabled')}">
+         <j:forEach var="dep" items="${pom.dependencies}">
+            <j:if test="${!dep.Type.equals('jar')}">
+               <j:break/>
+            </j:if>
+            <ajar:update project="${pom}" id="${dep.GroupId}:${dep.ArtifactId}-src" version="${dep.Version}" resultVar="wasDownloaded"/>
+
+            <j:if test="${context.getVariable('maven.ajar.src.expand.enabled')}">
+               
+               <j:set var="src.jar" value="${maven.repo.local}/${dep.ArtifactDirectory}/${dep.Type}s/${dep.ArtifactId}-src-${dep.Version}.${dep.Type}"/>
+               <j:set var="src.jar.exists" value="false"/>
+               <u:available file="${src.jar}">
+                  <j:set var="src.jar.exists" value="true"/>
+               </u:available>
+
+               <j:set var="src.dir" value="${maven.repo.local}/${dep.ArtifactDirectory}/${dep.Type}s/${dep.ArtifactId}-src-${dep.Version}"/>
+               <j:set var="src.dir.exists" value="false"/>
+               <u:available file="${src.dir}">
+                  <j:set var="src.dir.exists" value="true"/>
+               </u:available>
+
+               <j:set var="unexpandedJarExists" value="${context.getVariable('src.jar.exists') and !context.getVariable('src.dir.exists')}" />
+
+               <j:if test="${context.getVariable('wasDownloaded') or context.getVariable('unexpandedJarExists')}">
+                  <mkdir dir="${src.dir}" />
+                  <unjar src="${src.jar}" dest="${src.dir}" />
+               </j:if>
+
+            </j:if>
+         </j:forEach>
+      </j:if>
+
+   </goal>
+
+   <!-- ================================================================== -->
+   <!-- A J A R : U P D A T E - A P I                                      -->
+   <!-- ================================================================== -->
+   <goal name="ajar:update-api">
+
+      <j:if test="${context.getVariable('maven.ajar.api.enabled')}">
+         <j:forEach var="dep" items="${pom.dependencies}">
+            <j:if test="${!dep.Type.equals('jar')}">
+               <j:break/>
+            </j:if>
+            <ajar:update project="${pom}" id="${dep.GroupId}:${dep.ArtifactId}-api" version="${dep.Version}" resultVar="wasDownloaded"/>
+            
+            <j:if test="${context.getVariable('maven.ajar.api.expand.enabled')}">
+
+               <j:set var="api.jar" value="${maven.repo.local}/${dep.ArtifactDirectory}/${dep.Type}s/${dep.ArtifactId}-api-${dep.Version}.${dep.Type}"/>
+               <j:set var="api.jar.exists" value="false"/>
+               <u:available file="${api.jar}">
+                  <j:set var="api.jar.exists" value="true"/>
+               </u:available>
+
+               <j:set var="api.dir" value="${maven.repo.local}/${dep.ArtifactDirectory}/${dep.Type}s/${dep.ArtifactId}-api-${dep.Version}"/>
+               <j:set var="api.dir.exists" value="false"/>
+               <u:available file="${api.dir}">
+                  <j:set var="api.dir.exists" value="true"/>
+               </u:available>
+
+               <j:set var="unexpandedJarExists" value="${context.getVariable('api.jar.exists') and !context.getVariable('api.dir.exists')}" />
+
+               <j:if test="${context.getVariable('wasDownloaded') or context.getVariable('unexpandedJarExists')}">
+                  <mkdir dir="${api.dir}" />
+                  <unjar src="${api.jar}" dest="${api.dir}" />
+               </j:if>
+               
+            </j:if>
+         </j:forEach>
+      </j:if>
+
+   </goal>
+
+</project>

Added: incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/plugin.properties
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/plugin.properties?view=auto&rev=111851
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/plugin.properties	Tue Dec 14 10:28:53 2004
@@ -0,0 +1,8 @@
+# -------------------------------------------------------------------
+# P L U G I N  P R O P E R T I E S
+# -------------------------------------------------------------------
+maven.ajar.src.enabled = true
+maven.ajar.src.expand.enabled = false
+
+maven.ajar.api.enabled = true
+maven.ajar.api.expand.enabled = false

Added: incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/project.properties
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/project.properties?view=auto&rev=111851
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/project.properties	Tue Dec 14 10:28:53 2004
@@ -0,0 +1,3 @@
+# -------------------------------------------------------------------
+# P R O J E C T  P R O P E R T I E S
+# -------------------------------------------------------------------

Added: incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/project.xml
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/project.xml?view=auto&rev=111851
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/project.xml	Tue Dec 14 10:28:53 2004
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+
+<project>
+
+  <pomVersion>3</pomVersion>
+  <id>maven-ajar-plugin</id>
+  <name>Maven Auxiliary Jar Auto-Retriever (AJAR) Plugin</name>
+  <currentVersion>1.0</currentVersion>
+  <description>Plugin for retrieving auxiliary (source, Javadoc, etc.) jar files from a remote repository.</description>
+  <shortDescription>Retrieve auxiliary jar files</shortDescription>
+
+  <versions>
+    <version>
+      <id>1.0</id>
+      <name>1.0</name>
+      <tag>HEAD</tag>
+    </version>
+  </versions>
+  
+  <developers>
+    <developer>
+      <name>Ian Springer</name>
+      <id>ips</id>
+      <email>ian.springer@hp.com</email>
+      <organization>Hewlett-Packard Company</organization>
+      <roles>
+        <role>Developer</role>
+      </roles>
+      <timezone>-5</timezone>
+    </developer>
+  </developers>  
+    
+  <dependencies>
+
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.0.4</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-jelly</groupId>
+      <artifactId>commons-jelly</artifactId>
+      <version>20030902.160215</version>
+    </dependency>
+
+    <dependency>
+      <groupId>maven</groupId>
+      <artifactId>maven</artifactId>
+      <version>1.0</version>
+    </dependency>
+
+  </dependencies>
+
+  <build>
+    <nagEmailAddress>dev@ws-rp.hpsen.com</nagEmailAddress>
+    <sourceDirectory>src/java</sourceDirectory>
+    <resources>
+      <resource>
+        <directory />
+        <includes>
+           <include>plugin.*</include>            
+           <include>project.*</include>
+        </includes>
+      </resource>
+    </resources>
+  </build>
+  
+</project>

Added: incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/src/java/DependencyRetriever.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/src/java/DependencyRetriever.java?view=auto&rev=111851
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/maven-plugins/maven-ajar-plugin/src/java/DependencyRetriever.java	Tue Dec 14 10:28:53 2004
@@ -0,0 +1,276 @@
+/*=============================================================================*
+ *  Copyright 2004 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.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.maven.MavenConstants;
+import org.apache.maven.project.Dependency;
+import org.apache.maven.project.Project;
+import org.apache.maven.repository.Artifact;
+import org.apache.maven.repository.GenericArtifact;
+import org.apache.maven.util.HttpUtils;
+import org.apache.maven.verifier.DependencyVerifier;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.util.Iterator;
+
+/**
+ * Jellybean for retrieving a Maven dependency from the remote respository.
+ *
+ * @author Ian Springer
+ */
+public class DependencyRetriever
+{
+
+    private static final Log LOG = LogFactory.getLog( DependencyVerifier.class );
+
+    private static final boolean IGNORE_ERRORS = false;
+    private static final boolean USE_TIMESTAMP = true;
+    private static final boolean USE_CHECKSUM = true;
+
+    private Project m_project;
+    private String m_id;
+    private String m_version;
+    private String m_type;
+    private String m_resultVar;
+
+    /**
+     * @param project
+     */
+    public void setProject( Project project )
+    {
+        m_project = project;
+    }
+
+    /**
+     * @param id
+     */
+    public void setId( String id )
+    {
+        m_id = id;
+    }
+
+    /**
+     * @param version
+     */
+    public void setVersion( String version )
+    {
+        m_version = version;
+    }
+
+    /**
+     * @param type
+     */
+    public void setType( String type )
+    {
+        m_type = type;
+    }
+
+    /**
+     * @param resultVar
+     */
+    public void setResultVar( String resultVar )
+    {
+        m_resultVar = resultVar;
+    }
+
+    /**
+     * DOCUMENT_ME
+     */
+    public void update()
+    {
+        processAttributes();
+        obtainArtifact( new GenericArtifact( createDependency() ) );
+    }
+
+    private void processAttributes()
+    {
+        if ( m_id == null )
+        {
+            throw new IllegalStateException( "The required attribute 'id' has not been set." );
+        }
+        if ( m_version == null )
+        {
+            throw new IllegalStateException( "The required attribute 'version' has not been set." );
+        }
+        if ( m_type == null )
+        {
+            m_type = "jar";
+        }
+    }
+
+    private void obtainArtifact( Artifact artifact )
+    {
+        boolean needRemoteDownload;
+        File artifactFile = new File( m_project.getContext().getMavenRepoLocal()
+                + "/" + artifact.getDependency().getArtifactDirectory()
+                + "/" + artifact.getDependency().getType() + "s"
+                + "/" + artifact.getDependency().getArtifact() );
+        artifact.setPath( artifactFile.getPath() );
+        if ( !artifact.exists() )
+        {
+            needRemoteDownload = true;
+        }
+        else if ( artifact.isSnapshot() )
+        {
+            // The artifact exists but we need to take into account the user
+            // being online and whether the artifact is a snapshot. If the user
+            // is online then snapshots are added to the list of failed dependencies
+            // so that a newer version can be retrieved if one exists. We make
+            // an exception when the user is working offline and let them
+            // take their chances with a strong warning that they could possibly
+            // be using an out-of-date artifact. We don't want to cripple users
+            // when working offline.
+            needRemoteDownload = m_project.getContext().getOnline().booleanValue();
+        }
+        else
+        {
+            needRemoteDownload = false;
+        }
+        if ( needRemoteDownload )
+        {
+            downloadRemoteArtifact( artifact );
+        }
+    }
+
+    /**
+     * Retrieve a <code>remoteFile</code> from the maven remote repositories and store it at <code>localFile</code>
+     *
+     * @param artifact the artifact to retrieve from the repositories.
+     *
+     * @return true if the retrieval succeeds, false otherwise.
+     */
+    private boolean downloadRemoteArtifact( Artifact artifact )
+    {
+        boolean artifactFound = false, artifactDownloaded = false;
+        LOG.debug( "Attempting to download " + artifact.getName() + "..." );
+        for ( Iterator iter = m_project.getContext().getMavenRepoRemote().iterator(); iter.hasNext(); )
+        {
+            String remoteRepo = (String) iter.next();
+
+            if ( remoteRepo.endsWith( "/" ) )
+            {
+                remoteRepo = remoteRepo.substring( 0, remoteRepo.length() - 1 );
+            }
+
+            // The username and password parameters are not being
+            // used here. Those are the "" parameters you see below.
+            String url = remoteRepo + "/" + artifact.getUrlPath();
+            url = StringUtils.replace( url, "//", "/" );
+
+            if ( !url.startsWith( "file" ) )
+            {
+                if ( url.startsWith( "https" ) )
+                {
+                    url = StringUtils.replace( url, "https:/", "https://" );
+                }
+                else
+                {
+                    url = StringUtils.replace( url, "http:/", "http://" );
+                }
+            }
+
+            // Attempt to retrieve the artifact and set the checksum if retrieval
+            // of the checksum file was successful.
+            try
+            {
+                String loginHost =
+                        (String) m_project.getContext().getVariable( MavenConstants.PROXY_LOGINHOST );
+                String loginDomain =
+                        (String) m_project.getContext().getVariable( MavenConstants.PROXY_LOGINDOMAIN );
+                String meterType =
+                        (String) m_project.getContext().getVariable( MavenConstants.DOWNLOAD_METER );
+                if ( meterType != null )
+                {
+                    HttpUtils.setMeterType( meterType );
+                }
+
+                long preModTime = artifact.getFile().lastModified();
+                HttpUtils.getFile( url,
+                        artifact.getFile(),
+                        IGNORE_ERRORS,
+                        USE_TIMESTAMP,
+                        m_project.getContext().getProxyHost(),
+                        m_project.getContext().getProxyPort(),
+                        m_project.getContext().getProxyUserName(),
+                        m_project.getContext().getProxyPassword(),
+                        loginHost,
+                        loginDomain,
+                        USE_CHECKSUM );
+                long postModTime = artifact.getFile().lastModified();
+                artifactDownloaded = artifactDownloaded || postModTime > preModTime;
+
+                // Artifact was found, continue checking additional remote repos (if any)
+                // in case there is a newer version (i.e. snapshots) in another repo
+                artifactFound = true;
+                if ( !artifact.isSnapshot() )
+                {
+                    break;
+                }
+            }
+            catch ( FileNotFoundException fnfe )
+            {
+                // Multiple repositories may exist, and if the file is not found
+                // in just one of them, it's no problem, and we don't want to
+                // even print out an error.
+                // if it's not found at all, artifactFound will be false, and the
+                // build _will_ break, and the user will get an error message
+            }
+            catch ( Exception e )
+            {
+                // If there are additional remote repos, then ignore exception
+                // as artifact may be found in another remote repo. If there
+                // are no more remote repos to check and the artifact wasn't found in
+                // a previous remote repo, then artifactFound is false indicating
+                // that the artifact could not be found in any of the remote repos
+                //
+                // arguably, we need to give the user better control (another command-
+                // line switch perhaps) of what to do in this case? Maven already has
+                // a command-line switch to work in offline mode, but what about when
+                // one of two or more remote repos is unavailable? There may be multiple
+                // remote repos for redundancy, in which case you probably want the build
+                // to continue. There may however be multiple remote repos because some
+                // artifacts are on one, and some are on another. In this case, you may
+                // want the build to break.
+                //
+                // print a warning, in any case, so user catches on to mistyped
+                // hostnames, or other snafus
+                LOG.debug( "Error retrieving artifact from " + url + ": " + e );
+
+            }
+        }
+        if ( artifactDownloaded )
+        {
+            LOG.info( "Downloaded " + artifact.getName() + " from remote repository." );
+        }
+        if ( m_resultVar != null )
+        {
+            m_project.getContext().setVariable( m_resultVar, new Boolean( artifactDownloaded ) );
+        }
+
+        return artifactFound;
+    }
+
+    private Dependency createDependency()
+    {
+        Dependency dep = new Dependency();
+        dep.setId( m_id );
+        dep.setVersion( m_version );
+        dep.setType( m_type );
+        return dep;
+    }
+}

Added: incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/maven-intellij-plugin-readme.txt
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/maven-intellij-plugin-readme.txt?view=auto&rev=111851
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/maven-intellij-plugin-readme.txt	Tue Dec 14 10:28:53 2004
@@ -0,0 +1,37 @@
+Maven Idea IntelliJ Dependency Updater
+
+
+This plugin will update an IntelliJ Idea project's .iml file based on a Maven project's dependencies.  
+
+Note the following:
+
+1. If an entry exists in the iml file which is NOT in the Maven dependecies, it will be removed.
+2. If an entry exists in the iml file and in the Maven dependencies, it will only be updated if the Maven dependency does not match the current value.
+3. If a modification to the iml file will occur, a backup file will be generated of the original file.  It will be named [project][date/time stamp].iml
+4. Only the root jar entries will be updated in the iml file.  This means if you've attached source or javadocs to a jar entry, then this information will be maintained when a jar entry is updated.  Since Maven does not handle src and javadoc entries in the repository, it is up to the user to keep these entries up to date in the IntelliJ ide.
+
+
+
+
+Install
+
+
+1. Copy the maven-intellij-plugin-1.0.jar to the %MAVEN_HOME%/plugins directory
+
+
+
+Update maven.xml:
+Add this goal to intercept the compile plugin:
+
+<preGoal name="java:compile">
+ <j:if test="${context.getVariable('idea.project.iml') != null}">
+   <attainGoal name="idea-update"/>
+ </j:if>
+</preGoal>
+
+
+In project.properties add this property to point to your IntelliJ project's .iml file :
+
+idea.project.iml=C:/Projects/ws-rp/ws-rf.iml (this should be the path to your project iml file)
+  
+  
\ No newline at end of file

Added: incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/plugin.jelly
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/plugin.jelly?view=auto&rev=111851
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/plugin.jelly	Tue Dec 14 10:28:53 2004
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+
+<project xmlns:ant="jelly:ant" xmlns:define="jelly:define"
+  xmlns:ideaupdater="ideaupdater">
+
+
+<define:taglib uri="ideaupdater">
+    
+    <define:jellybean
+      name="ideaupdater"
+      className="MavenIdeaImlUpdater"
+      method="update"
+      />
+ 
+</define:taglib> 
+  
+<goal name="idea-update" description="Updates IntelliJ's IML file with the current Dependencies">
+
+   <property name="lib" refid="maven.dependency.classpath"/>
+   <ideaupdater:ideaupdater
+        var="iu"
+        lib="${lib}" 
+        iml="${idea.project.iml}"
+   />   
+   </goal>
+
+</project>
\ No newline at end of file

Added: incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/plugin.properties
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/plugin.properties?view=auto&rev=111851
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/plugin.properties	Tue Dec 14 10:28:53 2004
@@ -0,0 +1,3 @@
+
+
+idea.project.iml=
\ No newline at end of file

Added: incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/project.xml
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/project.xml?view=auto&rev=111851
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/project.xml	Tue Dec 14 10:28:53 2004
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+
+<!-- Schema for this file is at: http://maven.apache.org/xsd/maven-project-3.0.0.xsd -->
+<!-- Reference for this file is at: http://maven.apache.org/reference/project-descriptor.html -->
+
+<project
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:noNamespaceSchemaLocation="http://maven.apache.org/xsd/maven-project-3.0.0.xsd">
+
+  <pomVersion>3</pomVersion>
+  <id>maven-intellij-plugin</id>
+  <name>Idea Plugin</name>
+  <currentVersion>1.0</currentVersion>
+  <organization/> 
+  <inceptionYear>2004</inceptionYear>
+  <gumpRepositoryId>jakarta</gumpRepositoryId>
+
+  <siteAddress>jakarta.apache.org</siteAddress>
+  <siteDirectory>
+    /www/maven.apache.org/
+  </siteDirectory>
+  <distributionDirectory>
+    /www/jakarta.apache.org/builds/jakarta-turbine-maven/
+  </distributionDirectory>
+  
+  <dependencies>
+  <dependency>
+        <groupId>xalan</groupId>
+        <artifactId>xalan</artifactId>
+        <version>2.4.1</version>
+        <url>http://xml.apache.org/xalan-j/</url>
+        <properties>
+          <classloader>root.maven</classloader>
+        </properties>
+    </dependency>
+ </dependencies> 
+  
+  <build>
+  <sourceDirectory>src</sourceDirectory>
+  <resources>
+        <resource>
+          <directory></directory>
+          <includes>
+            <include>plugin.jelly</include>            
+            <include>plugin.properties</include>
+            <include>project.xml</include>
+          </includes>
+        </resource>
+    </resources>
+  </build>
+</project>

Added: incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/src/MavenIdeaImlUpdater.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/src/MavenIdeaImlUpdater.java?view=auto&rev=111851
==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/maven-plugins/maven-intellij-plugin/src/MavenIdeaImlUpdater.java	Tue Dec 14 10:28:53 2004
@@ -0,0 +1,714 @@
+/*=============================================================================*
+ *  Copyright 2004 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.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import java.io.File;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+/**
+ * @author Sal Campana
+ */
+public class MavenIdeaImlUpdater
+{
+    private String m_iml;
+    private String m_lib;
+    private boolean m_isModified;
+
+    /**
+     * Component Element
+     */
+    private static final String COMPONENT_ELEM = "component";
+
+    /**
+     * Name Attribute
+     */
+    private static final String NAME_ATTRIB = "name";
+
+    /**
+     * NewModuleRootManager name value
+     */
+    private static final String NEW_ROOT_MANAGER_NAME = "NewModuleRootManager";
+
+    /**
+     * Type Attribute
+     */
+    private static final String TYPE_ATTRIB = "type";
+
+    /**
+     * Module-library type
+     */
+    private static final String MODULE_LIBRARY_TYPE = "module-library";
+
+    /**
+     * Order Entry Element
+     */
+    private static final String ORDER_ENTRY_ELEM = "orderEntry";
+
+    /**
+     * CLASSES Element
+     */
+    private static final String CLASSES_ELEM = "CLASSES";
+
+    /**
+     * root element
+     */
+    private static final String ROOT_ELEM = "root";
+
+    /**
+     * library element
+     */
+    private static final String LIBRARY_ELEM = "library";
+
+    /**
+     * URL attribute
+     */
+    private static final String URL_ATTRIB = "url";
+
+    /**
+     * JAVADOC element
+     */
+    private static final String JAVADOC_ELEM = "JAVADOC";
+
+    /**
+     * SOURCES element
+     */
+    private static final String SOURCES_ELEM = "SOURCES";
+
+    /**
+     * Date Format String for writing backup of original iml file
+     */
+    private static final String BACKUP_DATE_FORMAT = "yyMMddHHmmss";
+
+    /**
+     * IML extension
+     */
+    private static final String IML_FILE_EXTENSION = ".iml";
+
+    /**
+     * DOCUMENT_ME
+     */
+    private static final String LIBRARY_TYPE = LIBRARY_ELEM;
+    private Document m_originalDom;
+    private Document m_modifiableDom;
+    private File m_imlFile;
+
+    /**
+     * Creates a new {@link MavenIdeaImlUpdater} object.
+     */
+    public MavenIdeaImlUpdater()
+    {
+        //set the system property to ensure the TransformerFactory is setup
+        System.setProperty("javax.xml.transform.TransformerFactory",
+                           "org.apache.xalan.processor.TransformerFactoryImpl");
+    }
+
+    /**
+     * Sets the IML file path
+     *
+     * @param imlvar
+     */
+    public void setIml(String imlvar)
+    {
+        m_iml = imlvar;
+    }
+
+    /**
+     * Sets the Maven-passed-in delimited String of dependencies.
+     *
+     * @param libvar DOCUMENT_ME
+     */
+    public void setLib(String libvar)
+    {
+        m_lib = libvar;
+    }
+
+    /**
+     * Returns the IML file path.
+     *
+     * @return Iml file path
+     */
+    public String getIml()
+    {
+        return m_iml;
+    }
+
+    /**
+     * Returns the Maven-passed-in delimited dependency string/
+     *
+     * @return Maven-passed-in delimited dependency string
+     */
+    public String getLib()
+    {
+        return m_lib;
+    }
+
+    /**
+     * This operation reads in the IML file and determines if the Maven-passed-in dependencies match the dependencies in the
+     * IML.  If an entry was removed, then it is removed from the IML file.  If an entry is modified then the entry in the IML
+     * is modified.  If the Maven dependencies do not exist in the IML, then they are added to it.
+     *
+     * @throws ParserConfigurationException
+     * @throws IOException
+     * @throws SAXException
+     * @throws TransformerException
+     */
+    public void update()
+            throws IOException,
+                   ParserConfigurationException,
+                   SAXException,
+                   TransformerException
+    {
+
+        Map depMap;
+        m_isModified = false;
+
+        //get the Maven-defined dependencies parsed into a Map.
+        depMap = getDependencyMap();
+
+        if ((m_iml == null) || "".equals(m_iml))
+        {
+            throw new IllegalArgumentException("The iml path was null!  Please ensure you have set the System property "
+                                               + "\"idea.project.iml\" to point to your Idea project's .iml file.");
+        }
+
+        //load the doms for modifying and aintaining a backup.
+        m_imlFile = setupImlDoms();
+
+
+        udateDependencies(m_imlFile, depMap);
+
+
+        addRemainingNewDependencies(depMap);
+        updateImlFile(m_imlFile);
+    }
+
+    private void udateDependencies(File imlFile, Map depMap)
+            throws IOException
+    {
+        //get <component> nodes
+        NodeList componentElemNodes = m_modifiableDom.getElementsByTagName(COMPONENT_ELEM);
+        int componentNodesLength = componentElemNodes.getLength();
+
+        for (int m = 0; m < componentNodesLength; m++)
+        {
+            Node componentNode = componentElemNodes.item(m);
+
+            if (Node.ELEMENT_NODE == componentNode.getNodeType())
+            {
+                Node componentNameNode = componentNode.getAttributes().getNamedItem(NAME_ATTRIB);
+
+                //find the NewModuleRoot  <component name="NewModuleRootManager">
+                if ((componentNameNode != null)
+                    && componentNameNode.getNodeValue().equals(NEW_ROOT_MANAGER_NAME))
+                {
+                    //get the <orderEntry> nodes
+                    NodeList orderEntryNodes = componentNode.getChildNodes();
+
+                    for (int p = 0; p < orderEntryNodes.getLength(); p++)
+                    {
+                        Node orderEntry = orderEntryNodes.item(p);
+
+                        if (Node.ELEMENT_NODE == orderEntry.getNodeType())
+                        {
+                            if (ORDER_ENTRY_ELEM.equals(orderEntry.getNodeName()))
+                            {
+                                Node typeAttribute = orderEntry.getAttributes().getNamedItem(TYPE_ATTRIB);
+
+                                //find module library
+                                if ((typeAttribute != null))
+                                {
+                                    //remove any libraries...we don't deal with them.
+                                    removeLibraryType(typeAttribute, orderEntry, componentNode);
+
+                                    //if its a module library...
+                                    if (typeAttribute.getNodeValue().equals(MODULE_LIBRARY_TYPE))
+                                    {
+                                        NodeList libraryNodes = orderEntry.getChildNodes();
+
+                                        for (int j = 0; j < libraryNodes.getLength(); j++)
+                                        {
+                                            Node library = libraryNodes.item(j);
+
+                                            updateEntries(library, imlFile, depMap, componentNode, orderEntry);
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    private void updateImlFile(File imlFile)
+            throws TransformerException, IOException
+    {
+        //write modifiableDom
+        if (m_isModified)
+        {
+            //backup the original file...
+            SimpleDateFormat dateFormat = new SimpleDateFormat(BACKUP_DATE_FORMAT);
+            File tempFile =
+                    new File(m_iml.substring(0, m_iml.length() - 3) + dateFormat.format(new Date())
+                             + IML_FILE_EXTENSION);
+            writeFile(tempFile, m_originalDom);
+
+            //write the modified file....
+            writeFile(imlFile, m_modifiableDom);
+            System.out.println("Update of IntelliJ Idea was successful!");
+        }
+        else
+        {
+            System.out.println("The IntelliJ Idea .iml was up-to-date.  No changes were made.");
+        }
+    }
+
+    private void addRemainingNewDependencies(Map depMap) throws IOException
+    {
+        if (depMap.values().size() > 0)
+        {
+            System.out.println("Adding " + depMap.values().size()
+                               + " new entries to the IntelliJ Idea .iml file.");
+        }
+//write the rest of the dep map nodes into the doc
+        Iterator iterator = depMap.values().iterator();
+        Node newModuleRootManager = null;
+        NodeList componentNodes = m_modifiableDom.getElementsByTagName(COMPONENT_ELEM);
+
+        //locate the NewModuleRootManager Node again...
+        for (int l = 0; l < componentNodes.getLength(); l++)
+        {
+            Node root = componentNodes.item(l);
+
+            if (Node.ELEMENT_NODE == root.getNodeType())
+            {
+                Node nameNode = root.getAttributes().getNamedItem(NAME_ATTRIB);
+
+                if (NEW_ROOT_MANAGER_NAME.equals(nameNode.getNodeValue()))
+                {
+                    newModuleRootManager = root;
+                }
+            }
+
+            if (newModuleRootManager != null)
+            {
+                //write the rest of the deps into the file
+                while (iterator.hasNext())
+                {
+                    m_isModified = true;
+                    String jarurl = (String) iterator.next();
+                    Element orderEntry = m_modifiableDom.createElement(ORDER_ENTRY_ELEM);
+                    orderEntry.setAttribute(TYPE_ATTRIB, MODULE_LIBRARY_TYPE);
+                    Element library = m_modifiableDom.createElement(LIBRARY_ELEM);
+                    Element classes = m_modifiableDom.createElement(CLASSES_ELEM);
+                    Element rootElem = m_modifiableDom.createElement(ROOT_ELEM);
+                    rootElem.setAttribute(URL_ATTRIB, jarurl);
+
+                    orderEntry.appendChild(library);
+                    library.appendChild(classes);
+                    classes.appendChild(rootElem);
+                    library.appendChild(m_modifiableDom.createElement(JAVADOC_ELEM));
+                    library.appendChild(m_modifiableDom.createElement(SOURCES_ELEM));
+                    updateApiAndJavaDocs(library, jarurl, m_modifiableDom);
+                    newModuleRootManager.appendChild(orderEntry);
+                }
+            }
+        }
+    }
+
+    private void updateEntries(Node library, File imlFile, Map depMap, Node componentNode, Node orderEntry)
+            throws IOException
+    {
+        if (Node.ELEMENT_NODE == library.getNodeType())
+        {
+            NodeList libraryChildren = library.getChildNodes();
+
+            for (int k = 0; k < libraryChildren.getLength(); k++)
+            {
+                Node child = libraryChildren.item(k);
+
+                if (Node.ELEMENT_NODE == child.getNodeType())
+                {
+                    //find classes
+                    if (CLASSES_ELEM.equals(child.getNodeName()))
+                    {
+                        NodeList classesChildren = child.getChildNodes();
+
+                        for (int l = 0; l < classesChildren.getLength(); l++)
+                        {
+                            Node root = classesChildren.item(l);
+
+                            if (Node.ELEMENT_NODE == root.getNodeType())
+                            {     //get to the <root> tag
+                                if (ROOT_ELEM.equals(root.getNodeName()))
+                                {
+                                    NamedNodeMap attributes = root.getAttributes();
+                                    Node attribNode = attributes.getNamedItem("url");
+
+                                    //current jar file entry
+                                    String jarurl = attribNode.getNodeValue();
+
+                                    if (jarurl.indexOf("$MODULE_DIR$") > -1)
+                                    {
+                                        jarurl = updateModuleDirUrl(jarurl, imlFile);
+                                    }
+                                    else
+                                    {
+                                        //fix normal urls also
+                                        jarurl = buildCanonicalJarUrl(jarurl);
+                                    }
+
+                                    //if the current iml defined dep is not in the maven deps remove
+                                    if (!depMap.containsKey(getJarPath(jarurl)))
+                                    {
+                                        m_isModified = true;
+                                        componentNode.removeChild(orderEntry);
+                                        System.out.println("Removing " + jarurl
+                                                           + " entry from the IntelliJ Idea .iml file.");
+
+                                        continue;
+                                    }
+                                    else
+                                    {
+                                        String mavenDepJar =
+                                                (String) depMap.get(getJarPath(jarurl));
+
+                                        //if the entry in iml doesn't match new entry...update
+                                        if (!mavenDepJar.equals(buildJarUrl(jarurl)))
+                                        {
+                                            m_isModified = true;
+                                            //update with the new value
+                                            attribNode.setNodeValue(mavenDepJar);
+                                            System.out.println("Updated " + jarurl + " entry to "
+                                                               + mavenDepJar);
+                                        }
+
+                                        updateApiAndJavaDocs(library, mavenDepJar, m_modifiableDom);
+
+
+                                        //remove from the depMap to ensure it doesn't get written into the file later
+                                        depMap.remove(getJarPath(jarurl));
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    private void removeLibraryType(Node typeAttribute, Node orderEntry, Node componentNode)
+    {
+        if (typeAttribute.getNodeValue().equals(LIBRARY_TYPE))
+        {
+            System.out.println("Removing Library: "
+                               + orderEntry.getAttributes().getNamedItem(NAME_ATTRIB)
+                                 .getNodeValue()
+                               + " from the IntelliJ Idea .iml file.  The plugin maintains jar entries only.");
+            componentNode.removeChild(orderEntry);
+        }
+    }
+
+    private File setupImlDoms()
+            throws SAXException, IOException, ParserConfigurationException
+    {
+        //setup File for IML file...
+        File imlFile = new File(m_iml);
+
+        if (!imlFile.exists())
+        {
+            throw new IllegalArgumentException("The provided .iml path: " + m_iml
+                                               + " does not exist, please check your settings.");
+        }
+
+        //hold a ref to the original file
+        m_originalDom = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(imlFile);
+
+        //get a reference to modify
+        m_modifiableDom = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(imlFile);
+        return imlFile;
+    }
+
+    private void updateApiAndJavaDocs(Node library, String mavenDepJar, Document modifiableDom) throws IOException
+    {
+        //jar:.....
+        String firstHalfUrl = mavenDepJar.substring(0, mavenDepJar.lastIndexOf("-"));
+        //...jar!/
+        String secondHalfUrl = mavenDepJar.substring(mavenDepJar.lastIndexOf("-"));
+
+        String apiURLString = null;
+        String apiJarURL = firstHalfUrl + "-api" + secondHalfUrl;
+
+        String srcURLString = null;
+        String srcJarURLString = firstHalfUrl + "-src" + secondHalfUrl;
+
+        //check for dir...remove jar from beginning and .jar!/ from end, then add file
+        String srcDirURL = "file" + srcJarURLString.substring(3, srcJarURLString.length() - 6);
+        //File srcLocation = new File(getJarFilePath(srcJarURLString));
+        File srcLocation = new File(srcDirURL.substring(6));
+        srcURLString = srcDirURL;
+        if (!srcLocation.exists())
+        {
+            //remove  !/ from the back
+            srcJarURLString = srcJarURLString.substring(0, srcJarURLString.length());
+            srcLocation = new File(getJarFilePath(srcJarURLString));
+            srcURLString = srcJarURLString;
+        }
+
+        //check for dir...remove jar from beginning and .jar!/ from end, then add file
+        String apiDirURL = "file" + apiJarURL.substring(3, apiJarURL.length() - 6);
+        //strip off file:// before testing if it is there
+        File apiLocation = new File(apiDirURL.substring(6));
+        apiURLString = apiDirURL;
+        if (!apiLocation.exists())
+        {
+            //remove !/ from the back
+            apiJarURL = apiJarURL.substring(0, apiJarURL.length());
+            apiLocation = new File(getJarFilePath(apiJarURL));
+            apiURLString = apiJarURL;
+        }
+        apiURLString = apiURLString.replace('\\', '/');
+        srcURLString = srcURLString.replace('\\', '/');
+
+        NodeList childNodes = library.getChildNodes();
+        for (int p = 0; p < childNodes.getLength(); p++)
+        {
+            Node child = childNodes.item(p);
+            if (Node.ELEMENT_NODE == child.getNodeType())
+            {
+                setRootUrl(JAVADOC_ELEM, child, apiLocation, apiURLString, modifiableDom);
+                setRootUrl(SOURCES_ELEM, child, srcLocation, srcURLString, modifiableDom);
+            }
+        }
+    }
+
+    private void setRootUrl(String elementName, Node child, File file, String url, Document modifiableDom) throws IOException
+    {
+        if (elementName.equals(child.getNodeName()) && file.exists())
+        {
+            NodeList classesChildren = child.getChildNodes();
+            if (classesChildren.getLength() == 0)
+            {
+                //this is the case where the element is there but does not have a child for <root>
+                //so we add it
+                Element rootElem = modifiableDom.createElement(ROOT_ELEM);
+                rootElem.setAttribute(URL_ATTRIB, url);
+                child.appendChild(rootElem);
+                m_isModified = true;
+            }
+            else
+            {
+                for (int l = 0; l < classesChildren.getLength(); l++)
+                {
+                    Node root = classesChildren.item(l);
+
+                    if (Node.ELEMENT_NODE == root.getNodeType())
+                    {     //get to the <root> tag
+                        if (ROOT_ELEM.equals(root.getNodeName()))
+                        {
+                            NamedNodeMap attributes = root.getAttributes();
+                            Node attribNode = attributes.getNamedItem(URL_ATTRIB);
+
+                            //determine if this is a new entry or simply the same one...
+                            if(attribNode != null )
+                            {
+                                String imlFileUrl = attribNode.getNodeValue();
+                                if (imlFileUrl.lastIndexOf("") > -1)
+                                {
+                                    imlFileUrl = updateModuleDirUrl(imlFileUrl,m_imlFile);
+                                }
+                                //compare what is in the iml to the actual file path to see if change occurred
+                                if( !imlFileUrl.equals(file.toString()) )
+                                {
+                                m_isModified = true;
+                                attribNode.setNodeValue(url);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    private String updateModuleDirUrl(String jarurl, File imlFile) throws IOException
+    {
+        //strip off the $MODULE_DIR$
+        jarurl =
+        jarurl.substring(jarurl.lastIndexOf("$MODULE_DIR$") + "$MODULE_DIR$".length(),
+                         jarurl.length());
+        File newfile =
+                new File(imlFile.getParentFile().getCanonicalFile(),
+                         jarurl);
+        jarurl = newfile.getCanonicalPath();
+        if(jarurl.endsWith("!"))
+        {
+            jarurl = jarurl.substring(0, jarurl.lastIndexOf("!"));
+        }
+        return jarurl;
+    }
+
+    private String buildCanonicalJarUrl(String jarurl) throws IOException
+    {
+        if (jarurl.startsWith("jar://"))
+        {
+            String newJarUrl = jarurl.substring(6);
+            newJarUrl = newJarUrl.substring(0, newJarUrl.length() - 2);
+            File f = new File(newJarUrl);
+            newJarUrl = f.getCanonicalPath();
+            return buildJarUrl(newJarUrl);
+
+        }
+        return jarurl;
+    }
+
+    /**
+     * Writes a DOM to the filesystem using the Xalan TransformerFactory.
+     *
+     * @param file
+     * @param dom
+     * @throws TransformerException
+     * @throws IOException
+     */
+    private void writeFile(File file,
+                           Document dom)
+            throws TransformerException,
+                   IOException
+    {
+        file.createNewFile();
+
+        // Use a Transformer for output
+        TransformerFactory tFactory = TransformerFactory.newInstance();
+        Transformer transformer = tFactory.newTransformer();
+
+        DOMSource source = new DOMSource(dom);
+        StreamResult result = new StreamResult(file);
+        transformer.transform(source, result);
+    }
+
+    /**
+     * Returns a map of Maven-passed-in dependencies for the project.
+     * <p/>
+     * The key is the jar path jarPath() and the value is the IntelliJ required jar url buildJarUrl()
+     *
+     * @return Dependency map.
+     */
+    private Map getDependencyMap()
+            throws IOException
+    {
+        if ((m_lib == null) || "".equals(m_lib))
+        {
+            throw new IllegalArgumentException("The Maven-pseed-in dependency list was null!");
+        }
+
+        Map deps = new HashMap();
+        m_lib = m_lib.replace('\\', '/');
+        StringTokenizer tokenizer = new StringTokenizer(m_lib, File.pathSeparator);
+
+        while (tokenizer.hasMoreTokens())
+        {
+            String token = tokenizer.nextToken();
+            File f = new File(token);
+            deps.put(getJarPath(f.getCanonicalPath()),
+                     buildJarUrl(f.getCanonicalPath()));
+        }
+
+        return deps;
+    }
+
+    /**
+     * Returns the jar-path which is the path to the jar minus the "jar://" and -XXX.jar (version info) This is used to
+     * normalize the url string per jar file.
+     *
+     * @param url URL string to be modified
+     * @return jar pat minus "jar://" AND -XXX.jar (Maven Version info)
+     */
+    private String getJarPath(String url)
+    {
+        //strip off the -00....jar to ensure its the jar name without the version info
+        if (url.lastIndexOf("-") > 0)
+        {
+            url = url.substring(0,
+                                url.lastIndexOf("-"));
+
+            //remove if case with "jar://"
+            if (url.startsWith("jar"))
+            {
+                url = url.substring(6);
+            }
+        }
+
+        return url;
+    }
+
+    private String getJarFilePath(String jarURL)
+    {
+        String jarFilePath = jarURL;
+        if (jarURL.startsWith("jar://"))
+        {
+            jarFilePath = jarFilePath.substring(6);
+        }
+        if (jarURL.endsWith("!/"))
+        {
+            jarFilePath = jarFilePath.substring(0, jarFilePath.length() - 2);
+        }
+        return jarFilePath;
+    }
+
+    /**
+     * Builds the jar url as expected by the IntelliJ config.
+     *
+     * @param url
+     * @return
+     */
+    private String buildJarUrl(String url)
+    {
+        if (url.startsWith("jar"))
+        {
+            return url;
+        }
+        String newUrl = "jar://" + url;
+        if (!url.endsWith("!"))
+        {
+            newUrl = newUrl + "!/";
+        }
+        else
+        {
+            newUrl = newUrl + "/";
+        }
+        return newUrl;
+    }
+}
\ No newline at end of file

Modified: incubator/apollo/trunk/project.xml
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/project.xml?view=diff&rev=111851&p1=incubator/apollo/trunk/project.xml&r1=111850&p2=incubator/apollo/trunk/project.xml&r2=111851
==============================================================================
--- incubator/apollo/trunk/project.xml	(original)
+++ incubator/apollo/trunk/project.xml	Tue Dec 14 10:28:53 2004
@@ -368,26 +368,11 @@
         </unitTest>
         <resources>
             <resource>
-                <directory>${basedir}/src/java</directory>
+                <directory>src/java</directory>
                 <excludes>
                     <exclude>**/*.java</exclude>
                     <exclude>**/package.html</exclude>
                 </excludes>
-                <filtering>false</filtering>
-            </resource>
-            <resource>
-                <directory>${basedir}/src/test</directory>
-                <excludes>
-                    <exclude>**/*.java</exclude>
-                    <exclude>**/package.html</exclude>
-                </excludes>
-                <filtering>false</filtering>
-            </resource>
-            <resource>
-                <directory>${basedir}/src</directory>
-                <includes>
-                    <include>wsdl/jmuws/**</include>
-                </includes>
                 <filtering>false</filtering>
             </resource>
         </resources>

Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/i18n/Keys.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/i18n/Keys.java?view=diff&rev=111851&p1=incubator/apollo/trunk/src/java/org/apache/ws/resource/i18n/Keys.java&r1=111850&p2=incubator/apollo/trunk/src/java/org/apache/ws/resource/i18n/Keys.java&r2=111851
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/i18n/Keys.java	(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/i18n/Keys.java	Tue Dec 14 10:28:53 2004
@@ -16,10 +16,10 @@
 package org.apache.ws.resource.i18n;
 
 /**
- * i18n message keys and messages for the {@link org.apache.ws.resource} package
+ * I18n message keys and messages for the {@link org.apache.ws.resource} package
  * and all its subpackages.
  *
- * @author Ian P. Springer, Sal Campana
+ * @author Ian Springer, Sal Campana
  */
 public interface Keys
 {
@@ -192,7 +192,7 @@
     String SERVICE_OPT_UNDEFINED_IN_HOME = "SERVICE_OPT_UNDEFINED_IN_HOME";
 
     /**
-     * @msg Deriving the service's method name from the request: {0}
+     * @msg Deriving the service method name from the request: {0}
      */
     String DERIVE_SERVICE_NAME_FROM_REQ = "DERIVE_SERVICE_NAME_FROM_REQ";
 
@@ -200,14 +200,17 @@
      * @msg Unable to find method {0} with valid signature in service class {1}.
      */
     String UNABLE_TO_FIND_METHOD_IN_SERVICE = "UNABLE_TO_FIND_METHOD_IN_SERVICE";
+
     /**
      * @msg Found service method: {0}
      */
     String FOUND_SERVICE_METHOD = "FOUND_SERVICE_METHOD";
+
     /**
      * @msg Failed to create SOAP message.
      */
     String FAILED_TO_CREATE_SOAP_MSG = "FAILED_TO_CREATE_SOAP_MSG";
+
     /**
      * @msg Creating an instance of service class: {0}
      */
@@ -217,14 +220,17 @@
      * @msg Cleaning expired resources.
      */
     String CLEANING_EXPIRED_RESOURCES = "CLEANING_EXPIRED_RESOURCES";
+
     /**
      * @msg Finding resource with key: {0}
      */
     String FINDING_RESOURCE_WITH_KEY = "FINDING_RESOURCE_WITH_KEY";
+
     /**
      * @msg ResourceKey was null.
      */
     String NULL_KEY = "NULL_KEY";
+
     /**
      * @msg Initializing Home
      */
@@ -234,6 +240,7 @@
      * @msg The ResourceKey name was null, please check the jndi-config.xml file.
      */
     String RESOURCE_KEYNAME_NULL = "RESOURCE_KEYNAME_NULL";
+
     /**
      * @msg The Resource Class name was null, please check the jndi-config.xml file.
      */
@@ -243,6 +250,7 @@
      * @msg Failed to destroy resource: {0} Cause: {1}
      */
     String FAILED_TO_DESTROY_RESOURCE = "FAILED_TO_DESTROY_RESOURCE";
+
     /**
      * @msg Removed the resource {0} with key: {1}
      */
@@ -403,7 +411,7 @@
      */
     String SCHEMA_MUST_BE_DOC = "SCHEMA_MUST_BE_DOC";
     /**
-     * @msg Specified XmlObject's type {0} is not a document type.
+     * @msg Specified XMLBean ({0}) is not a document type.
      */
     String XMLOBJECT_DOC = "XMLOBJECT_DOC";
     /**

---------------------------------------------------------------------
To unsubscribe, e-mail: apollo-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: apollo-dev-help@ws.apache.org