Fórum

Build war file without version number?

Gwowen Fu, modificado 9 Anos atrás.

Build war file without version number?

Expert Postagens: 315 Data de Entrada: 27/12/10 Postagens Recentes
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 9 Anos atrás.

RE: Build war file without version number?

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
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 9 Anos atrás.

RE: Build war file without version number?

Expert Postagens: 315 Data de Entrada: 27/12/10 Postagens Recentes
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 9 Anos atrás.

RE: Build war file without version number?

Liferay Master Postagens: 978 Data de Entrada: 03/01/10 Postagens Recentes
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 9 Anos atrás.

RE: Build war file without version number?

Regular Member Postagens: 149 Data de Entrada: 29/08/12 Postagens Recentes
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 7 Anos atrás.

RE: Build war file without version number?

Junior Member Postagens: 57 Data de Entrada: 10/11/08 Postagens Recentes
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 7 Anos atrás.

RE: Build war file without version number?

Junior Member Postagens: 65 Data de Entrada: 25/03/10 Postagens Recentes
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 7 Anos atrás.

RE: Build war file without version number?

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
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.