Yaml generated is not parsable
jehon opened this issue · 3 comments
Version report
Jenkins and plugins versions report:
Jenkins: 2.303.2
OS: Linux - 5.4.72-microsoft-standard-WSL2
---
bouncycastle-api:2.20
command-launcher:1.2
jaxb:2.3.0
jdk-tool:1.0
script-security:1.75
sshd:3.0.3
thinBackup:1.10
trilead-api:1.0.4
The docker I use is the jenkins/jenkins docker image.
Reproduction steps
Step 1: export the list of plugins:
jenkins-plugin-cli --list --output yaml > list.yml
Step 2: import the list of plugins
jenkins-plugin-cli --plugin-file list.yml
Results
Expected result:
The plugin list is updated
Actual result:
com.fasterxml.jackson.dataformat.yaml.snakeyaml.error.MarkedYAMLException: while scanning a simple key
in 'reader', line 3, column 1:
thinBackup 1.10
^
could not find expected ':'
in 'reader', line 5, column 1:
Bundled plugins:
^
at [Source: (FileInputStream); line: 2, column: 18]
at com.fasterxml.jackson.dataformat.yaml.snakeyaml.error.MarkedYAMLException.from(MarkedYAMLException.java:28)
at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:407)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:435)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1405)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:362)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:195)
at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:322)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4593)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3585)
at io.jenkins.tools.pluginmanager.util.PluginListParser.parsePluginYamlFile(PluginListParser.java:85)
at io.jenkins.tools.pluginmanager.cli.CliOptions.getPlugins(CliOptions.java:283)
at io.jenkins.tools.pluginmanager.cli.CliOptions.setup(CliOptions.java:156)
at io.jenkins.tools.pluginmanager.cli.Main.main(Main.java:48)
Caused by: while scanning a simple key
in 'reader', line 3, column 1:
thinBackup 1.10
^
could not find expected ':'
in 'reader', line 5, column 1:
Bundled plugins:
^
at org.yaml.snakeyaml.scanner.ScannerImpl.stalePossibleSimpleKeys(ScannerImpl.java:463)
at org.yaml.snakeyaml.scanner.ScannerImpl.needMoreTokens(ScannerImpl.java:278)
at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:226)
at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:586)
at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:168)
at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:403)
... 11 more
The actual yaml file is:
Installed plugins:
thinBackup 1.10
Bundled plugins:
All requested plugins:
Plugins that will be downloaded:
Resulting plugin list:
thinBackup 1.10
Done
Hi I am not able generate YAML (not in container)
Command I use java -jar jenkins-plugin-manager-*.jar --war jenkins.war -d testing --output yaml
Note:- testing is a directory in which I installed plugins
Steps I follow are
Step 1 Install plugins in testing directory: java -jar jenkins-plugin-manager-*.jar --war jenkins.war --plugin-file plugins.txt --plugins delivery-pipeline-plugin:1.3.2 deployit-plugin -d testing
Step 2 Generate YAML:- java -jar jenkins-plugin-manager-*.jar --war jenkins.war -d testing --output yaml
I have an existing plugins.txt
file and an existing directory of plugins called ref/plugins
. It generates yaml output when I use the command:
$ java -jar jenkins-plugin-manager-*.jar --jenkins-version 2.332.2 --plugin-download-directory ref/plugins \
--plugin-file plugins.txt --no-download --available-updates --output yaml
If I remove the --plugin-file plugins.txt
argument, the output is empty. I believe that running without providing --plugin-file
is what is requested in #227 and that is not yet implemented.
See the instructions on jenkins.io to generate a new plugins.txt file from a running Jenkins installation. It is done from the groovy script console in Jenkins with the command:
Jenkins.instance.pluginManager.plugins
.collect()
.sort { it.getShortName() }
.each {
plugin -> println("${plugin.getShortName()}:${plugin.getVersion()}")
}
return