Foros de discusión

Build war file without version number?

Gwowen Fu, modificado hace 9 años.

Build war file without version number?

Expert Mensajes: 315 Fecha de incorporación: 27/12/10 Mensajes recientes
Hi,

I use liferay-maven-plugin to build the war file and it ends with version number.
How could war be created without version number added?

I tried adding <warFile> or <warFileName> in <configuration> but the output war still ends with version number.

			<plugin>
				<groupid>com.liferay.maven.plugins</groupid>
				<artifactid>liferay-maven-plugin</artifactid>
				<version>${liferay.maven.plugin.version}</version>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>build-css</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<autodeploydir>${liferay.auto.deploy.dir}</autodeploydir>
					<appserverdeploydir>${liferay.app.server.deploy.dir}</appserverdeploydir>
					<appserverlibglobaldir>${liferay.app.server.lib.global.dir}</appserverlibglobaldir>
					<appserverportaldir>${liferay.app.server.portal.dir}</appserverportaldir>
					<liferayversion>${liferay.version}</liferayversion>
					<plugintype>portlet</plugintype>
				</configuration>
			</plugin>


I can include another "maven-war-plugin"plugin to build the war file without the version number added but is this really necessary?

Thank!
Gwowen
thumbnail
David H Nebinger, modificado hace 9 años.

RE: Build war file without version number?

Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
You can leave the version number on there, Gwowen. It is dropped during hot deployment so it doesn't become part of your URL or anything. It won't hurt, and it allows you to see the version number of your built war artifacts.
Gwowen Fu, modificado hace 9 años.

RE: Build war file without version number?

Expert Mensajes: 315 Fecha de incorporación: 27/12/10 Mensajes recientes
David H Nebinger:
You can leave the version number on there, Gwowen. It is dropped during hot deployment so it doesn't become part of your URL or anything. It won't hurt, and it allows you to see the version number of your built war artifacts.


Hi David,

The version number wasn't dropped when the project is build by Maven. Inside Eclipse, the Liferay->Maven->Liferay-deploy command will copy the war file (with version number) to the deploy directory and it is also not dropped when deployed to webapp directory. That's why I am changing the POM file.

Thanks!
Gwowen
thumbnail
Jack Bakker, modificado hace 9 años.

RE: Build war file without version number?

Liferay Master Mensajes: 978 Fecha de incorporación: 3/01/10 Mensajes recientes
Gwowen Fu:
David H Nebinger:
You can leave the version number on there, Gwowen. It is dropped during hot deployment so it doesn't become part of your URL or anything. It won't hurt, and it allows you to see the version number of your built war artifacts.

The version number wasn't dropped when the project is build by Maven. Inside Eclipse, the Liferay->Maven->Liferay-deploy command will copy the war file (with version number) to the deploy directory and it is also not dropped when deployed to webapp directory. That's why I am changing the POM file.
Gwowen

I see the version in the war filename getting dropped on hot deploy, but unfortunately the version number stays there in a service jar filename...
thumbnail
Dominik Marks, modificado hace 9 años.

RE: Build war file without version number?

Regular Member Mensajes: 149 Fecha de incorporación: 29/08/12 Mensajes recientes
You can define the name of the final war inside the pom.xml as follows:

<build>
 <finalname>the-desired-name-of-your-war-file-here</finalname>
 ...
</build>
thumbnail
Dominik Hofbauer, modificado hace 7 años.

RE: Build war file without version number?

Junior Member Mensajes: 57 Fecha de incorporación: 10/11/08 Mensajes recientes
Dominik Marks:
You can define the name of the final war inside the pom.xml as follows:

<build>
 <finalname>the-desired-name-of-your-war-file-here</finalname>
 ...
</build>


Thanks, this post saved my day!

For recap: After a POM update by a developer, we had a maven-war-plugin configuration to override the <warName>${project.artifactId}</warName>. This resulted in a deployment error with the liferay-maven-plugin, speaking when calling mvn liferay:deploy it said "angular-portlet.war does not exist".

(It also returned "build success" emoticon )

So removing the warName-property and modifying the war name in build->finalName did the job. The plugin deployed to the server again without any errors.
thumbnail
Orin Fink, modificado hace 7 años.

RE: Build war file without version number?

Junior Member Mensajes: 65 Fecha de incorporación: 25/03/10 Mensajes recientes
If your Maven artifact name ends in -portlet or -theme or one of Liferay's "expected" naming conventions, then, only then will the version number be dropped by default (without specification of finalName property). At least for Liferay versions up through 6.2 as far as I know.

Does this sound like what you would expect also?
thumbnail
David H Nebinger, modificado hace 7 años.

RE: Build war file without version number?

Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
This may or may not work for some application containers.

TC, for example, depend on the -portlet, -theme, etc suffixes to trigger the Liferay auto/hot deploy mechanisms. That's why Liferay stamps all projects by default with these suffixes, the deploy process.

Failure to adhere to the Liferay suffix standard may affect your auto/hot deploy success.