Do you think IIT Guwahati certified course can help you in your career?
No
Introduction
Play Framework is a free, open-source web application based on the model-view-controller (MVC) architectural paradigm. It was created in Scala and is compatible with Java and other programming languages compiled to JVM bytecode. It is built on Akka and delivers predictable and low resource usage (CPU, memory, threads) for highly scalable applications.
In this blog, we will learn how to debug a build in play framework.
Debugging Dependency
You may need to utilize some of the built-in facilities that System Build Tool (SBT) offers to help you debug your build if you are having trouble getting it to do what you want it to.
By default, SBT creates reports of all your dependencies, including conflict resolution tables that explain how SBT chooses which version of a dependency to use when several versions were requested and dependency trees that indicate which dependencies transitively brought in other dependents.
The reports are produced as XML files and come with an XSL stylesheet that enables browsers that support XSL to transform the XML reports to HTML. Firefox and Safari are two browsers that have this functionality, notably leaving out Chrome.
Debugging Setting
SBToffers a few helpful commands that may be used to understand your build and identify potential problem areas.
Show Command
The show command displays the return value of any sbt task. For example, if you're unsure whether a certain source file is being compiled, you may use show sources to determine if sbt is included in the sources:
The inspect command displays specific information about a task, such as what it depends on, where it was declared, and so on. You may use it similarly to the showcommand:
The managedSources command, which we have examined in this case, informs us that this is a job that generates a series of files and contains a description of Sources produced by the build. You can see that it depends on both the sources and sourceGeneratorstasks.
Inspect Tree Command
A complete tree of task dependencies for a certain job is displayed using the inspect tree command. If we look at the unmanagedSources task's tree, we can see it as follows:
This shows the whole pipeline used by SBT to find the sources in your project, including the filters used to select which files should be included or omitted. The inspect tree command comes in handy when you're unsure of how a certain component of your build is organized and want to see how everything fits together before delving further.
Debugging Incremental Compilation
People frequently complain that Play reloads and recompiles when they didn't expect it to. This frequently results from code generators or IDEs that unintentionally alter Play's classpath components, necessitating a reload. We may review the build task's debug log to troubleshoot issues like these. Whether it displays the log output or not, sbt collects it all throughout task execution so that you may review it later. Use the last command to inspect it.
Let's assume that after compilation, a file has to be recompiled:
[my-first-app] $ compile
[info] Compiling 1 Scala source to my-first-app/target/scala-2.13/classes...
You can also try this code with Online Java Compiler
By running the last compile, you may retrieve a full debug log of what happened during the compile command. There will be a lot of output from this, but just the first section, which is displayed below, is of relevance to us.
Play Framework is a free, open-source web application based on the model-view-controller (MVC) architectural paradigm. It is built on Akka and delivers predictable and low resource usage (CPU, memory, threads) for highly scalable applications.
What is debugging?
It is the process of identifying and removing computer hardware or software errors.
What does SBT stand for?
SBT stands for System Build Tools.
What is MVC?
MVC is an architectural paradigm that divides an application into three basic logical components: the model, the view, and the controller.
What is HTTP?
HTTP stands for Hypertext Transfer Protocol is an application-layer protocol for transmitting hypermedia documents, such as HTML. It was designed for communication between web browsers and web servers.