Hi, 

I'm using the workflow plugin combined with the nexus maven plugin.  When 
performing a 'org.sonatype.plugins:nexus-staging-maven-plugin:1.6.5:deploy' 
a file is created in the workspace under target/ which contains the 
stagingRepositoryId property.  This id is required by the workflow script 
later on in order to release the staging repo but the file itself is a 
generated file name.

As the properties file does not have a consistent filename I'm unable to 
read the file in, to get the property value.  There is a 
(https://issues.jenkins-ci.org/browse/JENKINS-26669) which suggests using a 
wildcard should be fine but I've not been able to get it to work or find an 
example.

i.e. the kind of things I've been trying are..

stage 'test'
node {
   ws ('my-maven-project') {
    
     def matcher = readFile('target/nexus-staging/staging/*.properties')
      // or
     def str = readFile file: 'target/nexus-staging/staging/*.properties', 
encoding : 'utf-8'
  }
}

Should I be able to do something like this?  If not is there another 
approach I could take to get the property value if I don't know what the 
filename is and am not able to use the java.io.File [1] when using jenkins 
master and slaves?

Thanks James.


[1] taken 
from 
https://github.com/jenkinsci/workflow-plugin/blob/master/TUTORIAL.md#adding-more-complex-logic

*"Do not try to use java.io.File methods, because these will refer to files 
on the master where Jenkins is running, not in the current workspace"*


-- 
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/1223f717-9c19-4b59-b0ff-459188db96be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to