Search This Blog

Showing posts with label config. Show all posts
Showing posts with label config. Show all posts

Sunday, January 5, 2020

Jenkins :: 'cmd' is not recognized as an internal or external command, operable program or batch file. Build step 'Execute Windows batch command' marked build as failure

1. Open jenkins http://localhost:8080
2. Click Jenkins config (Manage Jenkins -> Configure System -> Global properties -> Environment variables: name=PATH, value= PATH >)


Note: add C:\WINDOWS\System32; rather than %SystemRoot%\system32


%systemroot% not taking in jenkins.

so your path value is C:\WINDOWS\System32;c:\jdk......




Friday, August 22, 2014

Grails Configuring your own Bean or Groovy Object

Configuring Additional Beans

Using the Spring Bean DSL

You can easily register new (or override existing) beans by configuring them in grails-app/conf/spring/resources.groovy which uses the Grails Spring DSL. Beans are defined inside a beans property (a Closure):
 
beans = {
    // beans here
}
 
As a simple example you can configure a bean with the following syntax:
import my.company.MyBeanImpl
beans = { myBean(MyBeanImpl) { someProperty = 42 otherProperty = "blue" } }
Once configured, the bean can be auto-wired into Grails artifacts and other classes that support dependency injection (for example BootStrap.groovy and integration tests) by declaring a public field whose name is your bean's name (in this case myBean):
 
class ExampleController {
def myBean … }


Referencing Existing Beans

Beans declared in resources.groovy or resources.xml can reference other beans by convention. For example if you had a BookService class its Spring bean name would be bookService, so your bean would reference it like this in the DSL:
beans = {
    productUtility ( ProductUtility )
            {
          someProperty = 42
          otherProperty = "blue"
          springSecurityService = ref ( "springSecurityService" )
            }
}
or like this in XML:
"myBean" class="my.company.MyBeanImpl"> 
"someProperty" value="42" />
    "otherProperty" value="blue" />
  "springSecurityService" ref="springSecurityService" />
The bean needs a public setter for the bean reference (and also the two simple properties), which in Groovy would be defined like this:
package my.company
class MyBeanImpl { Integer someProperty String otherProperty
   SpringSecurityService springSecurityService  or def springSecurityService 
}




Hit Counter


View My Stats