Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8533485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:58:26+00:00 2026-06-11T09:58:26+00:00

I use the Play Framework 2.0 (2.0.3). I have a Java project and want

  • 0

I use the Play Framework 2.0 (2.0.3).
I have a Java project and want to read the application version (appVersion) defined in Build.scala.

What I already saw is that it’s possible to read certain configuration details from the Application object provided to Global.java, but didn’t find a key called appVersion or similar.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:58:27+00:00Added an answer on June 11, 2026 at 9:58 am

    You can define the version in application.conf and let Build.scala read the value. I did this with the version number and application name. The following works in Play 2.0, there is an updated solution for Play 2.1.

    In project/Build.scala, load the configuration and get the properties:

    val conf = play.api.Configuration.load(new File("."))
    val appName    = conf.getString("app.name").getOrElse("unnamed application")
    val appVersion = conf.getString("app.version").getOrElse("0.0.0")
    

    In conf/application.conf define the properties:

    app.version = 1.0
    app.name = My Application
    

    Finally in your application it will be accessible with

     Play.application().configuration().getString("app.version")
    

    The configuration syntax has quite some features, so you can even go a little more crazy with your version or application names:

    app {
      major    = 1
      minor    = 2
      revision = 3
      version = ${app.major}.${app.minor}.${app.revision}
      name = My Application ${app.major}.${app.minor}
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to use scala parser inside Play Framework application. import scala.tools.nsc._ trait Foo
I have creating a learning application with play framework and i want to use
i am working on project using play 2 framework with java. I want to
I have a working Play Framework project. I'm using Play Framework version number 1.2.5
I recently stumbled upon Play framework while evaluating frameworks to use in a project.
I use media player control to play mp3 files in asp.net application. I want
I have a Play Framework application that sends emails using SMTP server. Now I
Am trying to use MSSQL server with Play Framework, In my application.conf db.url=jdbc:microsoft:sqlserver://localhost\SQL2008:1433;DatabaseName=testDB db.driver=com.microsoft.jdbc.sqlserver.SQLServerDriver
I have downloaded Play Framework from GitHub and compiled it. Now I want to
I have built an application based on play framework 2.0.3. I have placed some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.