Re: Tomcat plugin doesn't seem to be using build final name for context (seems to always use artifactId)

2009-12-17 Thread Olivier Lamy
ectory to deploy.
>     *
>     * @parameter expression = 
> "${project.build.directory}/${project.build.finalName}"
>     * @required
>     */
>    private File warDirectory;   //where is private File warFile??
>
>    // ------------------------------
>    // Protected Methods
>    // --
>
>    /**
>     * {...@inheritdoc}
>     */
>   �...@override
>    protected File getWarFile()
>    {
>        return warDirectory;              //why not warFile???
>    }
>
>    /**
>     * {...@inheritdoc}
>     */
>   �...@override
>    protected void validateWarFile()
>        throws MojoExecutionException
>    {
> //well and good for check on warDirectory
> //where is the check on the warFile???
>        if ( !warDirectory.exists() || !warDirectory.isDirectory() )
>        {
>            throw new MojoExecutionException( getMessage( 
> "ExplodedMojo.missingWar", warDirectory.getPath() ) );
>        }
>    }
> }
>
> it appears you found a BUG!
> good catch!
>
> Martin
> __
> Please do not alter/modify this transmission. Thank You
>
>
>
>
>> Date: Thu, 17 Dec 2009 10:23:49 -0500
>> Subject: Tomcat plugin doesn't seem to be using build final name for context 
>>  (seems to always use artifactId)
>> From: ric...@gmail.com
>> To: users@maven.apache.org
>>
>> I'm confused here. The docs
>> http://mojo.codehaus.org/tomcat-maven-plugin/usage.html state that the
>> default context is
>> Context path of /${project.build.finalName} if no explicit one is given.
>>
>> In my war pom I have:
>>
>> dataselector-web
>>
>> but I later have
>>
>> 
>>      dataselector
>>
>> The war builds fine to the name "dataselector.war" and I can manually
>> deploy it just fine, yet when I try to use the tomcat plugin it tries
>> to deploy to the context dataselector-web which is the artificatId and
>> not the finalName.
>>
>> What did I do wrong? I don't mind declaring the name in the tomcat
>> module config but all the examples I see show a hardcoded path for the
>> context. I dont' want to to hardcode that context path (eg
>> /Users/rick/tomcat/webapps/dataselector )
>>
>>
>> --
>> Rick R
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>> For additional commands, e-mail: users-h...@maven.apache.org
>>
>
> _
> Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
> http://clk.atdmt.com/GBL/go/177141664/direct/01/



-- 
Olivier

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



RE: Tomcat plugin doesn't seem to be using build final name for context (seems to always use artifactId)

2009-12-17 Thread Martin Gainty
he Tomcat webapp tag name to use
 */
protected String getTag()
{
return tag;
}

/**
 * Deploys the WAR to Tomcat.
 * 
 * @throws MojoExecutionException if there was a problem locating the WAR
 * @throws TomcatManagerException if the Tomcat manager request fails
 * @throws IOException if an i/o error occurs
 */
protected void deployWar()
throws MojoExecutionException, TomcatManagerException, IOException
{
validateWarFile();

getLog().info( getMessage( "AbstractDeployMojo.deployingWar", 
getDeployedURL() ) );

URL warURL = getWarFile().toURL();
log( getManager().deploy( getPath(), warURL, isUpdate(), getTag() ) );
}

/**
 * Deploys the context XML file to Tomcat.
 * @throws MojoExecutionException if there was a problem locating the 
context XML file
 * @throws TomcatManagerException if the Tomcat manager request fails
 * @throws IOException if an i/o error occurs
 */
protected void deployContext()
throws MojoExecutionException, TomcatManagerException, IOException
{
validateContextFile();

getLog().info( getMessage( "AbstractDeployMojo.deployingContext", 
getDeployedURL() ) );

URL contextURL = getContextFile().toURL();
log( getManager().deployContext( getPath(), contextURL, isUpdate(), 
getTag() ) );
}

/**
 * Deploys the WAR and context XML file to Tomcat.
 * @throws MojoExecutionException if there was a problem locating either 
the WAR or the context XML file
 * @throws TomcatManagerException if the Tomcat manager request fails
 * @throws IOException if an i/o error occurs
 */
protected void deployWarAndContext()
throws MojoExecutionException, TomcatManagerException, IOException
{
validateWarFile();
validateContextFile();

getLog().info( getMessage( "AbstractDeployMojo.deployingWarContext", 
getDeployedURL() ) );

URL warURL = getWarFile().toURL();
URL contextURL = getContextFile().toURL();
log( getManager().deployContext( getPath(), contextURL, warURL, 
isUpdate(), getTag() ) );
}
}

//and now concrete class which overrides Base
package org.codehaus.mojo.tomcat;

/*
 * 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.
 */

import java.io.File;

import org.apache.maven.plugin.MojoExecutionException;

/**
 * Deploy an exploded WAR to Tomcat.
 * 
 * @goal exploded
 * @author Mark Hobson 
 * @version $Id: ExplodedMojo.java 8855 2009-01-21 11:23:04Z olamy $
 * @todo depend on war:exploded when MNG-1649 resolved
 */
public class ExplodedMojo
extends AbstractDeployMojo
{
// --
// Mojo Parameters
// --

/**
 * The path of the exploded WAR directory to deploy.
 * 
 * @parameter expression = 
"${project.build.directory}/${project.build.finalName}"
 * @required
 */
private File warDirectory;   //where is private File warFile??

// --
// Protected Methods
// --

/**
 * {...@inheritdoc}
 */
@Override
protected File getWarFile()
{
return warDirectory;  //why not warFile???
}

/**
 * {...@inheritdoc}
 */
@Override
protected void validateWarFile()
throws MojoExecutionException
{
//well and good for check on warDirectory 
//where is the check on the warFile???
if ( !warDirectory.exists() || !warDirectory.isDirectory() )
{
throw new MojoExecutionException( getMessage( 
"ExplodedMojo.missingWar", warDirectory.getPath() ) );
}
}
}

it appears you found a BUG!
good catch!

Martin 
______________________ 
Please do not alter/modify this transmission. Thank You




> Date: Thu, 17 Dec 2009 10:23:49 -0500
> Subject: Tomcat plugin doesn't seem to be using build final na

Tomcat plugin doesn't seem to be using build final name for context (seems to always use artifactId)

2009-12-17 Thread Rick R
I'm confused here. The docs
http://mojo.codehaus.org/tomcat-maven-plugin/usage.html state that the
default context is
Context path of /${project.build.finalName} if no explicit one is given.

In my war pom I have:

dataselector-web

but I later have


 dataselector

The war builds fine to the name "dataselector.war" and I can manually
deploy it just fine, yet when I try to use the tomcat plugin it tries
to deploy to the context dataselector-web which is the artificatId and
not the finalName.

What did I do wrong? I don't mind declaring the name in the tomcat
module config but all the examples I see show a hardcoded path for the
context. I dont' want to to hardcode that context path (eg
/Users/rick/tomcat/webapps/dataselector )


--
Rick R

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org