* Updated artifactJson input to artifacts input
* Prioritized service directory from artifact object over the parameter input
* Returned error when service directory is not provided for the old usage
* Removed redudant line
* Initilized the variable in a loop
---------
Co-authored-by: ray chen <raychen@microsoft.com>
* Added 'ArtifactsJson' parameter
* Made script work for non-java
* Reduced duplicated parsing
* Fixed type error
---------
Co-authored-by: ray chen <raychen@microsoft.com>