Failed to build js-lib plugins from source

102 views
Skip to first unread message

Ravi H K

unread,
Nov 6, 2017, 2:49:53 AM11/6/17
to Jenkins Developers
Hi am trying to build plugins ace-editor,handlebars,momentjs and jquery-detached plugins.from source code https://github.com/jenkinsci/js-libs
But few files are not getting genreted inside *.hpi files.I noticed few thing like when executing maven command am getting warning messages.

Steps are followed:
2. Execute "mvn clean install"
3. Mvn command execution is successful but it shows few warnings bec of this it's not building few files.
Maven console log:

Cbash-4.2# mvn clean install
[INFO] Scanning for projects...
[WARNING] The POM for org.jenkins-ci.tools:maven-hpi-plugin:jar:2.0 is missing, no dependency information available
[WARNING] Failed to build parent project for org.jenkins-ci.ui:js-module-base:pom:1.2.1
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.jenkins-ci.ui:js-module-base:pom:1.2.1
[WARNING] 'profiles.profile[copy-jsmodules].activation.file.exists' Failed to interpolate file location ${project.basedir}/src/main/webapp/jsmodules for profile copy-jsmodules: ${project.basedir} expression not supported during profile activation, use ${basedir} instead
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.jenkins-ci.ui:jquery-detached:hpi:1.2.1
[WARNING] 'profiles.profile[copy-jsmodules].activation.file.exists' Failed to interpolate file location ${project.basedir}/src/main/webapp/jsmodules for profile copy-jsmodules: ${project.basedir} expression not supported during profile activation, use ${basedir} instead @ org.jenkins-ci.ui:js-module-base:1.2.1, /tmp/js-libs/js-module-base/pom.xml
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]

Missing files respective of plugins.
1. Jquery Detached.
 jsmodules/jqueryui1.js
 jsmodules/jquery2.js
 jsmodules/jqueryui1/style.css

2. ace-editor:Below are missing files
jsmodules/
jsmodules/ace-editor-119.js
jsmodules/ace-editor-122.js
jsmodules/test.js

3. MomentSj 
jsmodules/momentjs2.js

4. HandleBar
jsmodules/handlebars3.js

Could anyone please help me out here.





Message has been deleted

Ravi H K

unread,
Nov 6, 2017, 7:09:43 AM11/6/17
to Jenkins Developers
Versioning Details:
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T07:58:13Z)
Maven home: /usr/local/bin/apache-maven-3.5.2
Java version: 1.8.0_121

Ravi H K

unread,
Nov 7, 2017, 6:38:28 AM11/7/17
to Jenkins Developers
I could resolve the 4 warnings by replacing ${project.basedir} to ${basedir} in "js-module-base/pom.xml" file and could see some of the warnings are cleared.But still below warnings are present.

[WARNING] The POM for org.jenkins-ci.tools:maven-hpi-plugin:jar:2.0 is missing, no dependency information available
[WARNING] Failed to build parent project for org.jenkins-ci.ui:js-module-base:pom:1.2.1

Victor Martinez

unread,
Nov 7, 2017, 7:55:50 AM11/7/17
to Jenkins Developers
As far as I see that particular dependency exists:

Can you confirm check what remote repos are configured in your ~/.m2/settings.xml as suggested https://wiki.jenkins.io/display/JENKINS/Plugin+tutorial#Plugintutorial-SettingUpEnvironment ?

Cheers

Ravi H K

unread,
Nov 7, 2017, 8:32:12 AM11/7/17
to Jenkins Developers
Hi Victor,
Thanks for the response!
Actually in my case settings.xml file path present under /usr/local/bin/apache-maven-3.5.2/conf/settings.xml path.I tried with default settings and also tried with https://wiki.jenkins.io/display/JENKINS/Plugin+tutorial#Plugintutorial-SettingUpEnvironment ?
Here it's my latest 'cat settings.xml' Please let me know if am missing something here.
<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at


Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<!--
 | This is the configuration file for Maven. It can be specified at two levels:
 |
 |  1. User Level. This settings.xml file provides configuration for a single user,
 |                 and is normally provided in ${user.home}/.m2/settings.xml.
 |
 |                 NOTE: This location can be overridden with the CLI option:
 |
 |                 -s /path/to/user/settings.xml
 |
 |  2. Global Level. This settings.xml file provides configuration for all Maven
 |                 users on a machine (assuming they're all using the same Maven
 |                 installation). It's normally provided in
 |                 ${maven.conf}/settings.xml.
 |
 |                 NOTE: This location can be overridden with the CLI option:
 |
 |                 -gs /path/to/global/settings.xml
 |
 | The sections in this sample file are intended to give you a running start at
 | getting the most out of your Maven installation. Where appropriate, the default
 | values (values used when the setting is not specified) are provided.
 |
 |-->
  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  -->

  <!-- interactiveMode
   | This will determine whether maven prompts you when it needs input. If set to false,
   | maven will use a sensible default value, perhaps based on some other setting, for
   | the parameter in question.
   |
   | Default: true
  <interactiveMode>true</interactiveMode>
  -->

  <!-- offline
   | Determines whether maven should attempt to connect to the network when executing a build.
   | This will have an effect on artifact downloads, artifact deployment, and others.
   |
   | Default: false
  <offline>false</offline>
  -->

  <!-- pluginGroups
   | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
   | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
   | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
   |-->
  <pluginGroups>
    <!-- pluginGroup
     | Specifies a further group identifier to use for plugin lookup.
    <pluginGroup>com.your.plugins</pluginGroup>
    -->
  </pluginGroups>

  <!-- proxies
   | This is a list of proxies which can be used on this machine to connect to the network.
   | Unless otherwise specified (by system property or command-line switch), the first proxy
   | specification in this list marked as active will be used.
   |-->
  <proxies>
    <!-- proxy
     | Specification for one proxy, to be used in connecting to the network.
     |
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>proxy.host.net</host>
      <port>80</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
    -->
  </proxies>

  <!-- servers
   | This is a list of authentication profiles, keyed by the server-id used within the system.
   | Authentication profiles can be used whenever maven must make a connection to a remote server.
   |-->
  <servers>
    <!-- server
     | Specifies the authentication information to use when connecting to a particular server, identified by
     | a unique name within the system (referred to by the 'id' attribute below).
     |
     | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
     |       used together.
     |
    <server>
      <id>deploymentRepo</id>
      <username>repouser</username>
      <password>repopwd</password>
    </server>
    -->

    <!-- Another sample, using keys to authenticate.
    <server>
      <id>siteServer</id>
      <privateKey>/path/to/private/key</privateKey>
      <passphrase>optional; leave empty if not used.</passphrase>
    </server>
    -->
  </servers>

  <!-- mirrors
   | This is a list of mirrors to be used in downloading artifacts from remote repositories.
   |
   | It works like this: a POM may declare a repository to use in resolving certain artifacts.
   | However, this repository may have problems with heavy traffic at times, so people have mirrored
   | it to several places.
   |
   | That repository definition will have a unique id, so we can create a mirror reference for that
   | repository, to be used as an alternate download site. The mirror site will be the preferred
   | server for that repository.
   |-->
  <mirrors>
    <!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     |
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
    </mirror>
    <mirror>
      <id>repo.jenkins-ci.org</id>
      <mirrorOf>m.g.o-public</mirrorOf>
    </mirror>
     -->
  </mirrors>

  <!-- profiles
   | This is a list of profiles which can be activated in a variety of ways, and which can modify
   | the build process. Profiles provided in the settings.xml are intended to provide local machine-
   | specific paths and repository locations which allow the build to work in the local environment.
   |
   | For example, if you have an integration testing plugin - like cactus - that needs to know where
   | your Tomcat instance is installed, you can provide a variable here such that the variable is
   | dereferenced during the build process to configure the cactus plugin.
   |
   | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
   | section of this document (settings.xml) - will be discussed later. Another way essentially
   | relies on the detection of a system property, either matching a particular value for the property,
   | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
   | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
   | Finally, the list of active profiles can be specified directly from the command line.
   |
   | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
   |       repositories, plugin repositories, and free-form properties to be used as configuration
   |       variables for plugins in the POM.
   |
   |-->
  <profiles>
    <!-- profile
     | Specifies a set of introductions to the build process, to be activated using one or more of the
     | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
     | or the command line, profiles have to have an ID that is unique.
     |
     | An encouraged best practice for profile identification is to use a consistent naming convention
     | for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
     | This will make it more intuitive to understand what the set of introduced profiles is attempting
     | to accomplish, particularly when you only have a list of profile id's for debug.
     |
     | This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
    <profile>
      <id>jdk-1.4</id>

      <activation>
        <jdk>1.4</jdk>
      </activation>

      <repositories>
        <repository>
          <id>jdk14</id>
          <name>Repository for JDK 1.4 builds</name>
          <url>http://www.myhost.com/maven/jdk14</url>
          <layout>default</layout>
          <snapshotPolicy>always</snapshotPolicy>
        </repository>
      </repositories>
    </profile>

    <profile>
      <id>jenkins</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>

      <repositories>
        <repository>
          <id>repo.jenkins-ci.org</id>
          <url>https://repo.jenkins-ci.org/public/</url>
        </repository>
      </repositories>

      <pluginRepositories>
        <pluginRepository>
          <id>repo.jenkins-ci.org</id>
          <url>https://repo.jenkins-ci.org/public/</url>
        </pluginRepository>
      </pluginRepositories>
     </profile>
    -->

    <!--
     | Here is another profile, activated by the system property 'target-env' with a value of 'dev',
     | which provides a specific path to the Tomcat instance. To use this, your plugin configuration
     | might hypothetically look like:
     |
     | ...
     | <plugin>
     |   <groupId>org.myco.myplugins</groupId>
     |   <artifactId>myplugin</artifactId>
     |
     |   <configuration>
     |     <tomcatLocation>${tomcatPath}</tomcatLocation>
     |   </configuration>
     | </plugin>
     | ...
     |
     | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
     |       anything, you could just leave off the <value/> inside the activation-property.
     |
    <profile>
      <id>env-dev</id>

      <activation>
        <property>
          <name>target-env</name>
          <value>dev</value>
        </property>
      </activation>

      <properties>
        <tomcatPath>/path/to/tomcat/instance</tomcatPath>
      </properties>
    </profile>
    -->
  </profiles>

  <!-- activeProfiles
   | List of profiles that are active for all builds.
   |
  <activeProfiles>
    <activeProfile>alwaysActiveProfile</activeProfile>
    <activeProfile>anotherAlwaysActiveProfile</activeProfile>
  </activeProfiles>
  -->
</settings>

Victor Martinez

unread,
Nov 7, 2017, 9:13:18 AM11/7/17
to Jenkins Developers
what if you copy&paste that settings.xml somewhere else and run

mvn -U clean package -s <SETTINGS_FULL_PATH>


where <SETTINGS_FULL_PATH> is just the full path of the settings which its content is https://wiki.jenkins.io/display/JENKINS/Plugin+tutorial#Plugintutorial-SettingUpEnvironment

Cheers 

Ravi H K

unread,
Nov 7, 2017, 9:49:11 AM11/7/17
to Jenkins Developers
Hi Victor,

Thanks a lot.I don't see any warning when used below command.But i noticed one thing that when i do unzip of *.hpi files few missing files are not built and not part of *.hpi files.

For instance:
Output of the "unzip  jquery-detached.hpi " which is built from source.

bash-4.2# unzip jquery-detached/target/jquery-detached.hpi
Archive:  jquery-detached/target/jquery-detached.hpi
replace META-INF/MANIFEST.MF? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
  inflating: META-INF/MANIFEST.MF
  inflating: WEB-INF/licenses.xml
  inflating: WEB-INF/lib/jquery-detached.jar
  inflating: jsmodules/jqueryui1/images/ui-bg_diagonals-thick_18_b81900_40x40.png
  inflating: jsmodules/jqueryui1/images/ui-bg_diagonals-thick_20_666666_40x40.png
  inflating: jsmodules/jqueryui1/images/ui-bg_flat_10_000000_40x100.png
  inflating: jsmodules/jqueryui1/images/ui-bg_glass_100_f6f6f6_1x400.png
  inflating: jsmodules/jqueryui1/images/ui-bg_glass_100_fdf5ce_1x400.png
  inflating: jsmodules/jqueryui1/images/ui-bg_glass_65_ffffff_1x400.png
  inflating: jsmodules/jqueryui1/images/ui-bg_gloss-wave_35_f6a828_500x100.png
  inflating: jsmodules/jqueryui1/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
  inflating: jsmodules/jqueryui1/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
  inflating: jsmodules/jqueryui1/images/ui-icons_222222_256x240.png
  inflating: jsmodules/jqueryui1/images/ui-icons_228ef1_256x240.png
  inflating: jsmodules/jqueryui1/images/ui-icons_ef8c08_256x240.png
  inflating: jsmodules/jqueryui1/images/ui-icons_ffd27a_256x240.png
  inflating: jsmodules/jqueryui1/images/ui-icons_ffffff_256x240.png
  inflating: META-INF/maven/org.jenkins-ci.ui/jquery-detached/pom.xml
  inflating: META-INF/maven/org.jenkins-ci.ui/jquery-detached/pom.properties

Output of the "unzip  jquery-detached.hpi " which is directly downloaded from https://updates.jenkins-ci.org/download/plugins/jquery-detached/

Archive:  jquery-detached.hpi
   creating: META-INF/
  inflating: META-INF/MANIFEST.MF
   creating: jsmodules/
   creating: jsmodules/jqueryui1/
   creating: jsmodules/jqueryui1/images/
   creating: WEB-INF/
   creating: WEB-INF/lib/
  inflating: jsmodules/jquery2.js
  inflating: jsmodules/jqueryui1/images/ui-bg_diagonals-thick_18_b81900_40x40.png
  inflating: jsmodules/jqueryui1/images/ui-bg_diagonals-thick_20_666666_40x40.png
  inflating: jsmodules/jqueryui1/images/ui-bg_flat_10_000000_40x100.png
  inflating: jsmodules/jqueryui1/images/ui-bg_glass_100_f6f6f6_1x400.png
  inflating: jsmodules/jqueryui1/images/ui-bg_glass_100_fdf5ce_1x400.png
  inflating: jsmodules/jqueryui1/images/ui-bg_glass_65_ffffff_1x400.png
  inflating: jsmodules/jqueryui1/images/ui-bg_gloss-wave_35_f6a828_500x100.png
  inflating: jsmodules/jqueryui1/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
  inflating: jsmodules/jqueryui1/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
  inflating: jsmodules/jqueryui1/images/ui-icons_222222_256x240.png
  inflating: jsmodules/jqueryui1/images/ui-icons_228ef1_256x240.png
  inflating: jsmodules/jqueryui1/images/ui-icons_ef8c08_256x240.png
  inflating: jsmodules/jqueryui1/images/ui-icons_ffd27a_256x240.png
  inflating: jsmodules/jqueryui1/images/ui-icons_ffffff_256x240.png
  inflating: jsmodules/jqueryui1/style.css
  inflating: jsmodules/jqueryui1.js
  inflating: WEB-INF/lib/jquery-detached.jar
  inflating: WEB-INF/licenses.xml
   creating: META-INF/maven/
   creating: META-INF/maven/org.jenkins-ci.ui/
   creating: META-INF/maven/org.jenkins-ci.ui/jquery-detached/
  inflating: META-INF/maven/org.jenkins-ci.ui/jquery-detached/pom.xml
  inflating: META-INF/maven/org.jenkins-ci.ui/jquery-detached/pom.properties

Missing files are:
 jsmodules/jqueryui1.js
 jsmodules/jquery2.js
 jsmodules/jqueryui1/style.css

Any thoughts on this?

Ravi H K

unread,
Nov 8, 2017, 4:53:09 AM11/8/17
to Jenkins Developers

Hi All,

My requirement is to build jenkins plugins binaries i.e ace-editor,handlebars,momentjs and jquery-detached from source code.and Install jenkins with these plugins.Note: Rest all plugins are built from source code and has been verified jenkins functionality.

In order to achieve this i followed below steps:

1. Downloaded latest js-lib source code from https://github.com/jenkinsci/js-libs
2. Followed the work around as mentioned in previous mail chain.and able to execute below command without any warnings.
mvn -U install -s  <SETTINGS_FULL_PATH>
3. Later copied the *.hpi files from the target folder(For instant "jquery-detached/target/jquery-detached.hpi") for the ace-editor,handlebars,momentjs and jquery-detached. Replaced the *.hpi files into *.jpi format.
4. Built the jenkins with these plugins.
5. Jenkins is up and running successfully.But i login to jenkins UI in some pages "text box' is not appearing because of this am not able to enter any data into those text fields.
Issue observed in Login to jenkins UI > Click on 'New Item' > Enter some text "Enter an item name" field > select "Pipeline" > click on 'OK' button > Scroll down the page and observe 'Script' Text box is no more visible.Attached 'script text box.PNG' for your reference.

The root cause i found that,When we build these plugins from source code.Below files are not built as a part of *.hpi files

Missing files respective of plugins.
1. Jquery Detached.
 jsmodules/jqueryui1.js
 jsmodules/jquery2.js
 jsmodules/jqueryui1/style.css
2. ace-editor:Below are missing files
jsmodules/
jsmodules/ace-editor-119.js
jsmodules/ace-editor-122.js
jsmodules/test.js
3. MomentSj
jsmodules/momentjs2.js
4. HandleBar
jsmodules/handlebars3.js

Is there any alternative ways to build these plugins?Or am i missing something here?

Ravi H K

unread,
Nov 13, 2017, 5:58:52 AM11/13/17
to Jenkins Developers
Can anyone please have a lookinto this and let me know any thoughts/suggestions?

Tom Fennelly

unread,
Jan 14, 2018, 9:28:09 AM1/14/18
to Jenkins Developers
Reply all
Reply to author
Forward
0 new messages