can i change the name of the uploaded/installed artifact?
Hi, next day, next problem ;-)) I'm right now fighting with the name that comes out of the war packaging. My artifact is a webapp, called distributeme-registry and is a module of a larger project. However, the automatically generated client expects it to be accessable under http://host:port/distributeme/ . Hence I need my artifact to be called distributeme.war. I added this as finalName into the build section of the pom, and it generates distributeme.war allright, but publishes it under the 'proper' name: [INFO] Building war: /Users/another/projects/distributeme/distributeme-registry/target/distributeme.war [INFO] WEB-INF/web.xml already added, skipping [INFO] [install:install {execution: default-install}] [INFO] Installing /Users/another/projects/distributeme/distributeme-registry/target/distributeme.war to /Users/another/.m2/repository/net/anotheria/distributeme-registry/1.0.1-SNAPSHOT/distributeme-registry-1.0.1-SNAPSHOT.war is there any chance to force maven to deploy it as /Users/another/.m2/repository/net/anotheria/distributeme-registry/1.0.1-SNAPSHOT/distributeme.war regards Leon - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: can i change the name of the uploaded/installed artifact?
Hi, You can modify the finalName tag to change the name of artifact. By default it is defined like the following: ${artifactId}-${version} Or you can modify it only in the war plugin by changing the warName parameter (see http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html). I personally recommend the first way. Regards, Reynald On Tuesday, January 4, 2011 at 23:26 , Leon Rosenberg wrote: > Hi, > > next day, next problem ;-)) > > I'm right now fighting with the name that comes out of the war packaging. > My artifact is a webapp, called distributeme-registry and is a module > of a larger project. However, > the automatically generated client expects it to be accessable under > http://host:port/distributeme/ . > Hence I need my artifact to be called distributeme.war. > I added this as finalName into the build section of the pom, and it > generates distributeme.war allright, but publishes it under the > 'proper' name: > > > [INFO] Building war: > /Users/another/projects/distributeme/distributeme-registry/target/distributeme.war > [INFO] WEB-INF/web.xml already added, skipping > [INFO] [install:install {execution: default-install}] > [INFO] Installing > /Users/another/projects/distributeme/distributeme-registry/target/distributeme.war > to > /Users/another/.m2/repository/net/anotheria/distributeme-registry/1.0.1-SNAPSHOT/distributeme-registry-1.0.1-SNAPSHOT.war > > is there any chance to force maven to deploy it as > /Users/another/.m2/repository/net/anotheria/distributeme-registry/1.0.1-SNAPSHOT/distributeme.war > > regards > Leon > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > > >
Re: can i change the name of the uploaded/installed artifact?
Hello Renald, On Tue, Jan 4, 2011 at 11:53 PM, Reynald Borer wrote: > Hi, > > > You can modify the finalName tag to change the name of artifact. By default > it is defined like the following: > > > ${artifactId}-${version} > > thats exactly what I did, and as I wrote before it builds it under the name I gave it, but publishes under the default name: built as distributeme.war published as /Users/another/.m2/repository/net/anotheria/distributeme-registry/1.0.1-SNAPSHOT/distributeme-registry-1.0.1-SNAPSHOT.war regards Leon > > > Or you can modify it only in the war plugin by changing the warName parameter > (see http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html). > > > I personally recommend the first way. > > > Regards, > Reynald > > > > On Tuesday, January 4, 2011 at 23:26 , Leon Rosenberg wrote: > >> Hi, >> >> next day, next problem ;-)) >> >> I'm right now fighting with the name that comes out of the war packaging. >> My artifact is a webapp, called distributeme-registry and is a module >> of a larger project. However, >> the automatically generated client expects it to be accessable under >> http://host:port/distributeme/ . >> Hence I need my artifact to be called distributeme.war. >> I added this as finalName into the build section of the pom, and it >> generates distributeme.war allright, but publishes it under the >> 'proper' name: >> >> >> [INFO] Building war: >> /Users/another/projects/distributeme/distributeme-registry/target/distributeme.war >> [INFO] WEB-INF/web.xml already added, skipping >> [INFO] [install:install {execution: default-install}] >> [INFO] Installing >> /Users/another/projects/distributeme/distributeme-registry/target/distributeme.war >> to >> /Users/another/.m2/repository/net/anotheria/distributeme-registry/1.0.1-SNAPSHOT/distributeme-registry-1.0.1-SNAPSHOT.war >> >> is there any chance to force maven to deploy it as >> /Users/another/.m2/repository/net/anotheria/distributeme-registry/1.0.1-SNAPSHOT/distributeme.war >> >> regards >> Leon >> >> - >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >> For additional commands, e-mail: users-h...@maven.apache.org >> >> >> >> > > > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: can i change the name of the uploaded/installed artifact?
On Jan 4, 2011, at 5:26 PM, Leon Rosenberg wrote: > Hi, > > next day, next problem ;-)) > > I'm right now fighting with the name that comes out of the war packaging. > My artifact is a webapp, called distributeme-registry and is a module > of a larger project. However, > the automatically generated client expects it to be accessable under > http://host:port/distributeme/ . > Hence I need my artifact to be called distributeme.war. > I added this as finalName into the build section of the pom, and it > generates distributeme.war allright, but publishes it under the > 'proper' name: > > > [INFO] Building war: > /Users/another/projects/distributeme/distributeme-registry/target/distributeme.war > [INFO] WEB-INF/web.xml already added, skipping > [INFO] [install:install {execution: default-install}] > [INFO] Installing > /Users/another/projects/distributeme/distributeme-registry/target/distributeme.war > to > /Users/another/.m2/repository/net/anotheria/distributeme-registry/1.0.1-SNAPSHOT/distributeme-registry-1.0.1-SNAPSHOT.war > > is there any chance to force maven to deploy it as > /Users/another/.m2/repository/net/anotheria/distributeme-registry/1.0.1-SNAPSHOT/distributeme.war > No, there isn't. You should use whatever mechanism your app server provides to set the context path. Justin > regards > Leon > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: can i change the name of the uploaded/installed artifact?
>-Original Message- >From: Reynald Borer [mailto:reynald.bo...@gmail.com] > >You can modify the finalName tag to change the name of artifact. By default >it is defined like the following: > > >${artifactId}-${version} > > That only affects what gets created in your "target" directory. Once the artifact gets uploaded to a repository (e.g. ~/.m2, or a central Nexus repo) the "standard" naming is enforced. The finalName tag is really only useful if you skip the deploy step and use the output artifact directly. (e.g. as part of a larger, non-maven build, or emailing it to a customer, etc...) eric - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: can i change the name of the uploaded/installed artifact?
Indeed. Sorry I read the topic too quickly to give a wrong answer ;-) Leon, why do you explicitly need to install the war file in your m2repo with a custom name? Couldn't you simply use the one you can find in the target/ folder? Or you can always use the maven-resources-plugin to copy the generated war to a given specific folder. Cheers, Reynald On Wednesday, January 5, 2011 at 19:30 , Haszlakiewicz, Eric wrote: > > > -Original Message- > > From: Reynald Borer [mailto:reynald.bo...@gmail.com] > > > > You can modify the finalName tag to change the name of artifact. By default > > it is defined like the following: > > > > > > ${artifactId}-${version} > > > > > > > > > > That only affects what gets created in your "target" directory. Once the > artifact gets uploaded to a repository (e.g. ~/.m2, or a central Nexus repo) > the "standard" naming is enforced. > > The finalName tag is really only useful if you skip the deploy step and use > the output artifact directly. (e.g. as part of a larger, non-maven build, or > emailing it to a customer, etc...) > > eric > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > > >
Re: can i change the name of the uploaded/installed artifact?
Hello Reynald, I posted it in my original post. The webapp have to be accessed by a specific context-path, e.g. http://host:port/distributeme/registry/list The easiest way to achieve it, is to name the war distributeme.war. In other words, for external users its easier to understand: "Download distributeme.war from xyz and place it under webapps in your app container " as "Download version-x from xyz, rename it to distributeme.war and than place it under webapps in your app container" regards Leon On Wed, Jan 5, 2011 at 7:52 PM, Reynald Borer wrote: > Indeed. Sorry I read the topic too quickly to give a wrong answer ;-) > > > Leon, why do you explicitly need to install the war file in your m2repo with > a custom name? Couldn't you simply use the one you can find in the target/ > folder? Or you can always use the maven-resources-plugin to copy the > generated war to a given specific folder. > > > Cheers, > Reynald > > > On Wednesday, January 5, 2011 at 19:30 , Haszlakiewicz, Eric wrote: > >> >> > -Original Message- >> > From: Reynald Borer [mailto:reynald.bo...@gmail.com] >> > >> > You can modify the finalName tag to change the name of artifact. By default >> > it is defined like the following: >> > >> > >> > ${artifactId}-${version} >> > >> > >> > >> > >> >> That only affects what gets created in your "target" directory. Once the >> artifact gets uploaded to a repository (e.g. ~/.m2, or a central Nexus repo) >> the "standard" naming is enforced. >> >> The finalName tag is really only useful if you skip the deploy step and use >> the output artifact directly. (e.g. as part of a larger, non-maven build, or >> emailing it to a customer, etc...) >> >> eric >> >> - >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >> For additional commands, e-mail: users-h...@maven.apache.org >> >> >> >> > > > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: can i change the name of the uploaded/installed artifact?
Understood. So you want your users to download the WAR directly from either your m2repo (weird) or from a Maven repository tool like Nexus, right? In that case, I don't think it's a Maven problem. You should consider deploying your generated war file to a web server like Apache (through maven-resources-plugin for example). Or you might also have an Apache in front of your Nexus server that is correctly configured to rewrite "/xyz/distributeme.war" to the correct location of the latest war in Nexus, and then it'll be downloaded as distributeme.war. Regards, Reynald On Wednesday, January 5, 2011 at 21:00 , Leon Rosenberg wrote: > Hello Reynald, > > I posted it in my original post. > The webapp have to be accessed by a specific context-path, e.g. > http://host:port/distributeme/registry/list > > The easiest way to achieve it, is to name the war distributeme.war. > > In other words, for external users its easier to understand: > "Download distributeme.war from xyz and place it under webapps in your > app container " > as > "Download version-x from xyz, rename it to distributeme.war and than > place it under webapps in your app container" > > regards > Leon > > > On Wed, Jan 5, 2011 at 7:52 PM, Reynald Borer wrote: > > > Indeed. Sorry I read the topic too quickly to give a wrong answer ;-) > > > > > > Leon, why do you explicitly need to install the war file in your m2repo > > with a custom name? Couldn't you simply use the one you can find in the > > target/ folder? Or you can always use the maven-resources-plugin to copy > > the generated war to a given specific folder. > > > > > > Cheers, > > Reynald > > > > > > On Wednesday, January 5, 2011 at 19:30 , Haszlakiewicz, Eric wrote: > > > > > > > > > > > > > > -Original Message- > > > > From: Reynald Borer [mailto:reynald.bo...@gmail.com] > > > > > > > > You can modify the finalName tag to change the name of artifact. By > > > > default > > > > it is defined like the following: > > > > > > > > > > > > ${artifactId}-${version} > > > > > > > > > > > > > > > > > > > > > > That only affects what gets created in your "target" directory. Once the > > > artifact gets uploaded to a repository (e.g. ~/.m2, or a central Nexus > > > repo) the "standard" naming is enforced. > > > > > > The finalName tag is really only useful if you skip the deploy step and > > > use the output artifact directly. (e.g. as part of a larger, non-maven > > > build, or emailing it to a customer, etc...) > > > > > > eric > > > > > > - > > > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > > > For additional commands, e-mail: users-h...@maven.apache.org > > > > > > > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > > >
Re: can i change the name of the uploaded/installed artifact?
> The webapp have to be accessed by a specific context-path, e.g. > http://host:port/distributeme/registry/list > > The easiest way to achieve it, is to name the war distributeme.war. Each app server has its own way of handling this -- context.xml, weblogic, xml, etc. You could also just include all those configuration files in your war file directly. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: can i change the name of the uploaded/installed artifact?
On Wed, Jan 5, 2011 at 10:21 PM, Wayne Fay wrote: >> The webapp have to be accessed by a specific context-path, e.g. >> http://host:port/distributeme/registry/list >> >> The easiest way to achieve it, is to name the war distributeme.war. > > Each app server has its own way of handling this -- context.xml, > weblogic, xml, etc. You could also just include all those > configuration files in your war file directly. Unfortunately no. You can't set the context-path from within the webapp :-( regards Leon > > Wayne > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: can i change the name of the uploaded/installed artifact?
On 1/6/11 8:16 AM, Leon Rosenberg wrote: > On Wed, Jan 5, 2011 at 10:21 PM, Wayne Fay wrote: >>> The webapp have to be accessed by a specific context-path, e.g. >>> http://host:port/distributeme/registry/list >>> >>> The easiest way to achieve it, is to name the war distributeme.war. >> >> Each app server has its own way of handling this -- context.xml, >> weblogic, xml, etc. You could also just include all those >> configuration files in your war file directly. > > Unfortunately no. You can't set the context-path from within the webapp :-( > regards > Leon Um, no. You can certainly do this. There just isn't a standard way to do it across containers and, as Wayne says, each app server has its own way of handling it. Justin > >> >> Wayne >> >> - >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >> For additional commands, e-mail: users-h...@maven.apache.org >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: can i change the name of the uploaded/installed artifact?
On Thu, Jan 6, 2011 at 3:49 PM, Justin Edelson wrote: > On 1/6/11 8:16 AM, Leon Rosenberg wrote: >> >> Unfortunately no. You can't set the context-path from within the webapp :-( >> regards >> Leon > > Um, no. You can certainly do this. There just isn't a standard way to do > it across containers and, as Wayne says, each app server has its own way > of handling it. > > Justin > Cool! You know by chance how to achieve this in tomcat ? (6 or above). regards Leon - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: can i change the name of the uploaded/installed artifact?
> You know by chance how to achieve this in tomcat ? (6 or above). As I already said... context.xml. Check Google for more info. There are other config files used by other containers. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: can i change the name of the uploaded/installed artifact?
if you mean context.xml in META-INF -> than nope. Tomcat only allows you to change the context path from outside, for example from localhost/Catalina/distributeme.xml regards Leon On Thu, Jan 6, 2011 at 5:20 PM, Wayne Fay wrote: >> You know by chance how to achieve this in tomcat ? (6 or above). > > As I already said... context.xml. Check Google for more info. There > are other config files used by other containers. > > Wayne > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: can i change the name of the uploaded/installed artifact?
> if you mean context.xml in META-INF -> than nope. > Tomcat only allows you to change the context path from outside, for > example from localhost/Catalina/distributeme.xml The documentation suggests (to me) otherwise: http://tomcat.apache.org/tomcat-6.0-doc/config/context.html We don't use Tomcat as our primary container so I won't claim to be an expert with Tomcat. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: can i change the name of the uploaded/installed artifact?
On Thu, Jan 6, 2011 at 5:45 PM, Wayne Fay wrote: >> if you mean context.xml in META-INF -> than nope. >> Tomcat only allows you to change the context path from outside, for >> example from localhost/Catalina/distributeme.xml > > The documentation suggests (to me) otherwise: > http://tomcat.apache.org/tomcat-6.0-doc/config/context.html path he context path of this web application, which is matched against the beginning of each request URI to select the appropriate web application for processing. All of the context paths within a particular Host must be unique. If you specify a context path of an empty string (""), you are defining the default web application for this Host, which will process all requests not assigned to other Contexts. The value of this field must not be set except when statically defining a Context in server.xml, as it will be inferred from the filenames used for either the .xml context file or the docBase. And for the docBase: The value of this field must not be set when the Context is configured using a META-INF/context.xml file as it will be inferred by the automatic deployment process. So apparently not. But thank for good intentions anyway! regards Leon > > We don't use Tomcat as our primary container so I won't claim to be an > expert with Tomcat. > > Wayne > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: can i change the name of the uploaded/installed artifact?
On 1/6/11 12:05 PM, Leon Rosenberg wrote: > On Thu, Jan 6, 2011 at 5:45 PM, Wayne Fay wrote: >>> if you mean context.xml in META-INF -> than nope. >>> Tomcat only allows you to change the context path from outside, for >>> example from localhost/Catalina/distributeme.xml >> >> The documentation suggests (to me) otherwise: >> http://tomcat.apache.org/tomcat-6.0-doc/config/context.html > > path > he context path of this web application, which is matched against the > beginning of each request URI to select the appropriate web > application for processing. All of the context paths within a > particular Host must be unique. If you specify a context path of an > empty string (""), you are defining the default web application for > this Host, which will process all requests not assigned to other > Contexts. > > The value of this field must not be set except when statically > defining a Context in server.xml, as it will be inferred from the > filenames used for either the .xml context file or the docBase. > > And for the docBase: > The value of this field must not be set when the Context is configured > using a META-INF/context.xml file as it will be inferred by the > automatic deployment process. > > So apparently not. But thank for good intentions anyway! Hmm. This definitely worked at one point, but it sounds like it has been intentionally removed. Too bad. Sorry for the false hope. > > regards > Leon > >> >> We don't use Tomcat as our primary container so I won't claim to be an >> expert with Tomcat. >> >> Wayne >> >> - >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >> For additional commands, e-mail: users-h...@maven.apache.org >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: can i change the name of the uploaded/installed artifact?
> if you mean context.xml in META-INF -> than nope. > Tomcat only allows you to change the context path from outside, for > example from localhost/Catalina/distributeme.xml Perhaps the maven-tomcat-plugin can offer you an acceptable alternative? http://stackoverflow.com/questions/2593472/define-servlet-context-in-war-file http://mojo.codehaus.org/tomcat-maven-plugin/ Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org