JAVA EXAMPLE PROGRAMS

JAVA EXAMPLE PROGRAMS

Publish Your Article Here

How to list gradle project properties?


You can use gradle properties command to list the properties of a gradle project. Here is a simple build.gradle file for an example:

defaultTasks 'clean', 'run'
						
task clean << {
        println 'Default Task - Cleaning!'
}
task run << {
        println 'Default Task - Running!'
}
task mySpecTask << {
        println "I'm not a default task!"
}

Run "gradle properties"

java2novice$ gradle properties
:properties

------------------------------------------------------------
Root project
------------------------------------------------------------

allprojects: [root project 'gradle_tests']
ant: [email protected]
antBuilderFactory: [email protected]
artifacts: [email protected]ba380
asDynamicObject: [email protected]
buildDir: /Users/java2novice/gradle_tests/build
buildFile: /Users/java2novice/gradle_tests/build.gradle
buildScriptSource: [email protected]
buildscript: [email protected]b7e0
childProjects: {}
class: class org.gradle.api.internal.project.DefaultProject_Decorated
classLoaderScope: [email protected]8c9e870
clean: task ':clean'
components: []
configurations: []
convention: [email protected]
defaultTasks: [clean, run]
depth: 0
description: null
ext: [email protected]67ee75a5
extensions: [email protected]
fileOperations: [email protected]
fileResolver: [email protected]
gradle: build 'gradle_tests'
group: 
logger: [email protected]
logging: [email protected]
modelRegistry: [email protected]
module: [email protected]
mySpecTask: task ':mySpecTask'
name: gradle_tests
parent: null
parentIdentifier: null
path: :
plugins: [[email protected]]
processOperations: [email protected]
project: root project 'gradle_tests'
projectDir: /Users/java2novice/gradle_tests
projectEvaluationBroadcaster: ProjectEvaluationListener broadcast
projectEvaluator: [email protected]a08
projectRegistry: [email protected]
properties: {...}
repositories: []
resources: [email protected]d
rootDir: /Users/java2novice/gradle_tests
rootProject: root project 'gradle_tests'
run: task ':run'
scriptPluginFactory: [email protected]
serviceRegistryFactory: org.gradle.internal.service.scopes.ProjectScopeServ[email protected]
services: ProjectScopeServices
standardOutputCapture: [email protected]
state: project state 'EXECUTED'
status: release
subprojects: []
tasks: [task ':clean', task ':mySpecTask', task ':properties', task ':run']
version: unspecified

BUILD SUCCESSFUL

Total time: 1.831 secs

Reference: Gradle Documentation

<< Previous Program | Next Program >>

Gradle configuration examples

  1. Gradle Installation Steps
  2. What is gradle project and task
  3. What is build.gradle file?
  4. How to avoid gradle log messages?
  5. How to define default tasks in Gradle?
  6. How to list all gradle tasks?
  7. How to list gradle project properties?
  8. How to declare a task that depends on other task?
  9. How to create dynamic tasks in Gradle?
  10. How to exclude a task in gradle?
  11. How to create java project in gradle?
Java2Novice - YouTube Channel
  1. Python Tutorial for Beginners
Knowledge Centre
Interface and its usage
Interface is similar to a class which may contain method's signature only but not bodies and it is a formal set of method and constant declarations that must be defined by the class that implements it. Interfaces are useful for declaring methods that one or more classes are expected to implement, capturing similarities between unrelated classes without forcing a class relationship and determining an object's programming interface without revealing the actual body of the class.
Famous Quotations
If you don’t make mistakes, you’re not working on hard enough problems. And that’s a big mistake.
-- Frank Wilczek

About Author

I'm Nataraja Gootooru, programmer by profession and passionate about technologies. All examples given here are as simple as possible to help beginners. The source code is compiled and tested in my dev environment.

If you come across any mistakes or bugs, please email me to [email protected].

Most Visited Pages

Other Interesting Sites

Reference: Java™ Platform Standard Ed. 7 - API Specification | Java™ Platform Standard Ed. 8 - API Specification | Java is registered trademark of Oracle.
Privacy Policy | Copyright © 2019 by Nataraja Gootooru. All Rights Reserved.