Hello,

I have created a Symbol in TestRunPublisher for descriptor. The code now 
looks like following:


public class TestUploader extends Publisher implements SimpleBuildStep {
    private final String name;
    private final String password;
//getters are there for above variables.
    @DataBoundConstructor
    public TestUploader (String name, String password){
//set the data to class members.
    }
@Symbol("TestUploader")
    @Extension
    ublic static final class DescriptorImpl extends 
BuildStepDescriptor<Publisher> {
public DescriptorImpl () {
            load();
        }
    }
          public boolean isApplicable (Class<? extends AbstractProject> 
aClass) {return true;}

public String getDisplayName () {return "TestUploader";}

@Override
public boolean configure (StaplerRequest req, JSONObject formData) throws 
FormException {
    save();
    return super.configure(req, formData);
}
    }

I think I am missing out on something.


On Sunday, February 24, 2019 at 12:19:56 PM UTC+5:30, Richard Bywater wrote:
>
> You need to define a Symbol in your plugin.  See Defining Symbols section 
> at 
> https://jenkins.io/doc/developer/plugin-development/pipeline-integration/
>
> Richard
>
> On Sat, 23 Feb 2019, 11:25 AM prasad.pofali via Jenkins Users, <
> jenkins...@googlegroups.com <javascript:>> wrote:
>
>> I have developed a custom Jenkins plugin which extends *Recorder *and 
>> implements *SimpleBuildStep*. I was calling this plugin using the syntax:
>>
>> pipeline {
>>     agent any
>>     stages {
>>         stage('Build and Run Tests') {
>>             steps {
>>                 step([$class : 'TestClass', name: 'admin', lastname: 
>> 'admin', endPoint:'http://localhost:8080/', file:'path/to/myfile.txt'])
>>             }
>>         }
>>     }
>> }
>>
>>
>> With this the plugin is executed, but now my requirement is to call this 
>> plugin with the different pipeline syntax which is our primary requirement. 
>> The required syntax is as follows:
>>
>> pipeline {
>>     agent any
>>      stages {
>>          stage('Build and Run Tests') {
>>               steps {
>>                    TestClass name:'admin' lastname: 'admin' endPoint: '
>> http://localhost:8080/', file:'path/to/myfile.txt'
>>               }
>>           }
>>      }
>> }
>>
>>
>> But I am not able to call the same plugin with the above syntax. Can 
>> anyone please help me?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkinsci-use...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/db5c1523-75e2-4969-ba26-54dede193291%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/db5c1523-75e2-4969-ba26-54dede193291%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a882d3ba-768b-43f0-8c63-4dcc7f82ba3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to