Hello, maybe you could you use maven to declare the dependencies instead of downloading them manually. The IDE will download jars and resolve imports automatically, this is what I do when I develop shared library for example.
On Tue, Feb 16, 2021 at 1:47 PM Amedee Van Gasse <[email protected]> wrote: > I am happy to report that after adding the following jars to my lib > folder, I no longer have errors: > > jenkins-core-2.263.3.jar workflow-api-2.41.jar > workflow-cps-2.87.jar workflow-job-2.40.jar > workflow-step-api-2.23.jar > jenkins-core-2.263.3-javadoc.jar workflow-api-2.41-javadoc.jar > workflow-cps-2.87-javadoc.jar workflow-job-2.40-javadoc.jar > workflow-step-api-2.23-javadoc.jar > jenkins-core-2.263.3-sources.jar workflow-api-2.41-sources.jar > workflow-cps-2.87-sources.jar workflow-job-2.40-sources.jar > workflow-step-api-2.23-sources.jar > > The unfortunate part is that I still have to manually hunt down the > correct jars and add them to git, but at least I can finally start with > coding! > On Tuesday, February 16, 2021 at 1:21:23 PM UTC+1 Amedee Van Gasse wrote: > >> Answering my own question for at least the hudson.* and jenkins.* imports: >> >> * download jenkins-core for my Jenkins version from >> https://repo.jenkins-ci.org/ (in my case: version 2.263.3, so I need >> https://repo.jenkins-ci.org/releases/org/jenkins-ci/main/jenkins-core/2.263.3/jenkins-core-2.263.3.jar >> ) >> * save the jar in a directory lib >> * add the jar as a library to my project >> >> Now, at least for the hudson and jenkins imports, IntelliJ doesn't >> complain. >> I think I'll have to repeat for the Workflow plugin? >> >> Now, I know that this is the really old fashioned way of doing it, from >> the days of yore from before dependency management. >> I'd prefer not to have the lib folder with jars added to git. >> >> What would be a nice dependency management ish way of doing it? >> >> >> On Tuesday, February 16, 2021 at 1:08:01 PM UTC+1 Amedee Van Gasse wrote: >> >>> Following up on my previous question about a System Groovy Script. >>> >>> I have a .groovy file in a git repo. >>> I have cloned the git repo to my pc. >>> I have opened the directory in IntelliJ IDEA. >>> >>> Now I get a lot of red text. None of the imports are found. >>> It looks like this: >>> >>> import hudson.model.*; >>> import hudson.util.*; >>> import jenkins.model.*; >>> import hudson.FilePath.FileCallable; >>> import hudson.slaves.OfflineCause; >>> import hudson.node_monitors.*; >>> import org.jenkinsci.plugins.workflow.job.WorkflowRun >>> import org.jenkinsci.plugins.workflow.flow.FlowExecution; >>> import org.jenkinsci.plugins.workflow.graph.FlowGraphWalker; >>> import org.jenkinsci.plugins.workflow.graph.FlowNode; >>> import org.jenkinsci.plugins.workflow.graph.StepStartNode; >>> import org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode; >>> import org.jenkinsci.plugins.workflow.actions.WorkspaceAction >>> >>> How do I configure IntelliJ IDEA so that I no longer have red alerts on >>> the imports? >>> >>> For the record: I did not write this code. I have been asked to maintain >>> it, and fix a bug. >>> It's my professional opinion that all code should be under version >>> control, and I don't want to edit the code directly on the Jenkins web >>> pages but in a IDE so that I have syntax checking, autocomplete, and all >>> the other usual conveniences. >>> >>> You are allowed to assume that there are only 3 files in the repository: >>> a .groovy file, a .gitattributes and a .gitignore. I do know how to write >>> code in the Groovy language, but I don't know how to set up a Groovy >>> project. As an analogy: I know how to fly a plane, but I don't know how to >>> take off or land. >>> >>> -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/215cec8c-1d63-42f3-b33e-29ae19646767n%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/215cec8c-1d63-42f3-b33e-29ae19646767n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Yannick -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAG1W_AzkUJ49g2_keurOwth-pkgqTkzBV1OahcEmXUwJL5ETWQ%40mail.gmail.com.
