# Is it possible to access task command line options before task execution?

**URL:** <https://discuss.gradle.org/t/is-it-possible-to-access-task-command-line-options-before-task-execution/27196>\
**Category:** Help/Discuss\
**Created:** [June 1, 2018, 8:26am UTC](https://discuss.gradle.org/t/is-it-possible-to-access-task-command-line-options-before-task-execution/27196 "2018-06-01T08:26:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Myllyenko](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@Myllyenko](https://discuss.gradle.org/u/Myllyenko)\
**Post date:** [June 1, 2018, 8:26am UTC](https://discuss.gradle.org/t/is-it-possible-to-access-task-command-line-options-before-task-execution/27196/1 "2018-06-01T08:26:02Z")

</div>

Before Gradle 4.6, I was using system properties to configure my task. The task accessed the properties’ values in the `project.afterEvaluate` block.

After migration to Gradle 4.6, I decided to replace system properties (somewhat ugly workaround for my purpose) with command line options (exactly what I need!) but I didn’t find a way to access their values before task execution (their setters are called after `afterEvaluate`).

I need to use these values in `afterEvaluate` because they are used to configure Maven publications. Can I still have success with command line options or have I to return to system properties?
