Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-3314

<import file="..."/> to inherit portions of configurations

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Critical Critical
    • core
    • None
    • Platform: PC, OS: All

      I'm trying to realize a way to unify some of the configurations in multiple
      project environment (hundreds of them).
      I was thinking about storing common configuration in common_config.xml and then
      import it into the config.xml of the specific project. So it could look like:
      <project>
      <property name="projectname" value="version"/>...
      <import file="../common_config.xml"/>
      </project>
      When the common_config.xml can be something like:
      <project>
      ....
      <customWorkspace>C:\Ivy\apache-ivy-2.0.0\src\example\multi-
      project\projects\${projectname}</customWorkspace>
      <project/>

      But it seems that neither import or property usage are working.

      When trying to import I'm getting:
      Mar 18, 2009 4:30:59 PM hudson.util.RobustReflectionConverter doUnmarshal
      WARNING: Skipping a non-existent field import
      com.thoughtworks.xstream.converters.reflection.NonExistentFieldException: No suc
      h field hudson.model.FreeStyleProject.import
      at com.thoughtworks.xstream.converters.reflection.FieldDictionary.field(
      FieldDictionary.java:106)
      at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProv
      ider.getFieldType(PureJavaReflectionProvider.java:151)
      at hudson.util.RobustReflectionConverter.determineType(RobustReflectionC
      onverter.java:327)
      at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionCon
      verter.java:218)
      at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConve
      rter.java:173)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshall
      er.java:81)
      at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(A
      bstractReferenceUnmarshaller.java:55)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm
      arshaller.java:75)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm
      arshaller.java:59)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller
      .java:142)
      at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarsh
      al(AbstractTreeMarshallingStrategy.java:33)
      at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:931)
      at hudson.util.XStream2.unmarshal(XStream2.java:65)
      at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:917)
      at com.thoughtworks.xstream.XStream.fromXML(XStream.java:861)
      at hudson.XmlFile.read(XmlFile.java:126)
      at hudson.model.Items.load(Items.java:109)
      at hudson.model.Hudson.load(Hudson.java:1837)
      at hudson.model.Hudson.access$500(Hudson.java:191)
      at hudson.model.Hudson$10.run(Hudson.java:2439)
      Mar 18, 2009 4:30:59 PM hudson.model.Hudson load
      WARNING: Failed to load C:\Documents and Settings\username\.hudson\jobs\version
      java.lang.NullPointerException
      at hudson.model.Project.updateTransientActions(Project.java:198)
      at hudson.model.AbstractProject.onLoad(AbstractProject.java:199)
      at hudson.model.Project.onLoad(Project.java:85)
      at hudson.model.Items.load(Items.java:110)
      at hudson.model.Hudson.load(Hudson.java:1837)
      at hudson.model.Hudson.access$500(Hudson.java:191)
      at hudson.model.Hudson$10.run(Hudson.java:2439)
      ******************************************************************

      When i was testing the property usage I've got:

      WARNING: Skipping a non-existent field property
      com.thoughtworks.xstream.converters.reflection.NonExistentFieldException: No suc
      h field hudson.model.FreeStyleProject.property
      at com.thoughtworks.xstream.converters.reflection.FieldDictionary.field(
      FieldDictionary.java:106)
      at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProv
      ider.getFieldType(PureJavaReflectionProvider.java:151)
      at hudson.util.RobustReflectionConverter.determineType(RobustReflectionC
      onverter.java:327)
      at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionCon
      verter.java:218)
      at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConve
      rter.java:173)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshall
      er.java:81)
      at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(A
      bstractReferenceUnmarshaller.java:55)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm
      arshaller.java:75)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm
      arshaller.java:59)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller
      .java:142)
      at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarsh
      al(AbstractTreeMarshallingStrategy.java:33)
      at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:931)
      at hudson.util.XStream2.unmarshal(XStream2.java:65)
      at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:917)
      at com.thoughtworks.xstream.XStream.fromXML(XStream.java:861)
      at hudson.XmlFile.read(XmlFile.java:126)
      at hudson.model.Items.load(Items.java:109)
      at hudson.model.Hudson.load(Hudson.java:1837)
      at hudson.model.Hudson.<init>(Hudson.java:513)
      at hudson.WebAppMain$2.run(WebAppMain.java:190)
      Mar 18, 2009 4:51:17 PM hudson.ivy.IvyBuildTrigger$1 doInIvyContext

      Which causes:

      WARNING: Parsing error while reading the ivy file C:\Ivy\apache-ivy-2.0.0\src\ex
      ample\multi-project\projects\${projectname}\ivy.xml

          [JENKINS-3314] <import file="..."/> to inherit portions of configurations

          Jesse Glick added a comment -

          Do you have some reason to believe that

          <import file="../common_config.xml"/>

          was ever intended to work? Ant has some similar syntax, but XML files in general
          do not.

          AFAIK there is no support for inheriting settings in Hudson projects. There was
          some RFE open for this, I think, but I cannot find it now.

          Jesse Glick added a comment - Do you have some reason to believe that <import file="../common_config.xml"/> was ever intended to work? Ant has some similar syntax, but XML files in general do not. AFAIK there is no support for inheriting settings in Hudson projects. There was some RFE open for this, I think, but I cannot find it now.

          eguess74 added a comment -

          i'm so used to such syntax in ant (both import and variables), so I probably do
          expect it to work everywhere I also saw the same functionality supported by
          CruiseControl.
          If it was not intended from the beginning then this should be transformed into
          feature request.
          I think this will add a lot to Hudson usability for large scale environments.

          eguess74 added a comment - i'm so used to such syntax in ant (both import and variables), so I probably do expect it to work everywhere I also saw the same functionality supported by CruiseControl. If it was not intended from the beginning then this should be transformed into feature request. I think this will add a lot to Hudson usability for large scale environments.

          Jesse Glick added a comment -

          Like I said, probably a duplicate, I just am not sure where to find the original
          now.

          Jesse Glick added a comment - Like I said, probably a duplicate, I just am not sure where to find the original now.

          mdonohue added a comment -

          Duplicate of issue 3157 - it's in the top 10 vote getters.

              • This issue has been marked as a duplicate of 3157 ***

          mdonohue added a comment - Duplicate of issue 3157 - it's in the top 10 vote getters. This issue has been marked as a duplicate of 3157 ***

            Unassigned Unassigned
            eguess74 eguess74
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: