Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » scout.application.version for development
scout.application.version for development [message #1854953] Tue, 20 September 2022 10:07 Go to next message
Miloslav Frajdl is currently offline Miloslav FrajdlFriend
Messages: 46
Registered: June 2018
Member
Hi.

A property "scout.application.version" exists in "config.properties" file. In "cz.a4b.tracetickets.ui.html.app.war" has value "${project.version}" and get version from "pom.xml" file.
In root "pom.xml" file is this definition:
  <groupId>cz.a4b</groupId>
  <artifactId>tracetickets</artifactId>
  <version>1.0.57-SNAPSHOT</version>
  <packaging>pom</packaging>

  <name>T-CODES Parent Module</name>

  <properties>
    <cz.a4b.tracetickets.version>${project.version}</cz.a4b.tracetickets.version>
    <jdk.source.version>11</jdk.source.version>
    <org.eclipse.scout.rt.version>11.0.42</org.eclipse.scout.rt.version>
    <master_npm_release_dependency_mapping>--mapping.0.regex=@eclipse-scout --mapping.0.version=${org.eclipse.scout.rt.version}</master_npm_release_dependency_mapping>
  </properties>


Unfortunately, in "cz.a4b.tracetickets.ui.html.app.dev/src/main/resources/config.properties" has property "scout.application.version" value "development". If change it to "${project.version}", this caused error "variable ${project.version} is not defined in the context" in starting UI.
I would like to display the current version number on the homepage even in development mode, not just the text "development".

For change version I use
mvn versions:set -DnewVersion=xxxxx
.

Can anyone advise me how to do this?

Thanks.
Re: scout.application.version for development [message #1855249 is a reply to message #1854953] Tue, 04 October 2022 13:06 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias VilligerFriend
Messages: 230
Registered: September 2011
Senior Member
Hi Miloslav

What version does your pom.xml use during development? Do you also set the development version using "mvn versions:set"?

If yes, you could e.g. create a Maven profile and replace the current version in the config.properties file e.g. by using the com.google.code.maven-replacer-plugin:replacer plugin. For the new value you can use the "newVersion" property. You could activate this profile when executing "mvn versions:set".

Does this help?

Kind regards
Mat
Re: scout.application.version for development [message #1855314 is a reply to message #1855249] Fri, 07 October 2022 16:00 Go to previous message
Miloslav Frajdl is currently offline Miloslav FrajdlFriend
Messages: 46
Registered: June 2018
Member
Mat,
thank you for response. Yes, I use "mvn versions:set". Unfortunately, I don't know how to create profiles. But I managed to find another workable way.

1.
I have cmd file for change version (version is %1 parameter):
C:
cd C:\Users\milos\eclipse-workspace-tracetickets\tracetickets\
echo %1
pause
echo project.version=%1> C:\Users\milos\eclipse-workspace-tracetickets\tracetickets\env.properties
mvn versions:set -DnewVersion=%1
pause


At line 5 I create file "env.properties" with one variable "project.version".

2.
In Eclipse in Run Configuration for "dev ui" I set new "VM argument":
-Dscout.env=file:/C:\Users\milos\eclipse-workspace-tracetickets\tracetickets\env.properties


3.
Then in file "tracetickets.ui.html.app.dev/src/main/resources/config.properties" I set property:
scout.application.version=${project.version}


This works reliably and as I need it to.

Thanks again for your help, even though I did it a little differently.
Previous Topic:My getDataByText() filter for a Smartfield is not working
Next Topic:How get http request header fields?
Goto Forum:
  


Current Time: Mon Mar 04 19:41:31 GMT 2024

Powered by FUDForum. Page generated in 0.02386 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top