New Jenkins Plugin - Slack File Uploader. (Problems in releasing)

1,123 views
Skip to first unread message

Shitij Goyal

unread,
Oct 8, 2016, 4:31:34 AM10/8/16
to Jenkins Developers
Hi,
I have just built a new Jenkins plugin to upload files to Slack.

 But when I am running the maven command to release it I'm getting the following error :-
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project SlackBuilder: Unable to commit files
Provider message:
The git-push command failed.
Command output:
ssh: Could not resolve hostname github.com:jenkinsci: nodename nor servname provided, or not known
fatal: Could not read from remote repository.

I have added the proper ssh keys and have made the Pr to the jenkins infa team which has been merged. 
My origin is set as follows (g...@github.com:jenkinsci/slack-uploader-plugin.git) and I am able to push it normally. But I am not able to push it using ssh. I have added the username and password in the settings.xml file but to no avail. A proper head hurting moment. Please help.

Daniel Beck

unread,
Oct 8, 2016, 5:02:51 AM10/8/16
to jenkin...@googlegroups.com
Does the advice in this thread help?

https://groups.google.com/d/msg/jenkinsci-dev/8LJapvieXlo/SwXcaA8fCQAJ
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/b9fad6a6-905d-452d-bc7c-d493701ab320%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Baptiste Mathus

unread,
Oct 8, 2016, 5:20:12 AM10/8/16
to Jenkins Developers

I think your URL format is wrong. Doesn't seem similar to https://github.com/jenkinsci/buildtriggerbadge-plugin/blob/master/pom.xml#L40 (notice the colon vs. slash).

Also, in general for that kind of issue you probably want to check some examples among the hundreds of existing plugins.

Cheers


Le 8 oct. 2016 11:02 AM, "Daniel Beck" <m...@beckweb.net> a écrit :
Does the advice in this thread help?

https://groups.google.com/d/msg/jenkinsci-dev/8LJapvieXlo/SwXcaA8fCQAJ

> On 08.10.2016, at 10:31, Shitij Goyal <goyal...@gmail.com> wrote:
>
> Hi,
> I have just built a new Jenkins plugin to upload files to Slack.
> github.com/jenkinsci/slack-uploader-plugin
>
>  But when I am running the maven command to release it I'm getting the following error :-
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project SlackBuilder: Unable to commit files
> Provider message:
> The git-push command failed.
> Command output:
> ssh: Could not resolve hostname github.com:jenkinsci: nodename nor servname provided, or not known
> fatal: Could not read from remote repository.
>
> I have added the proper ssh keys and have made the Pr to the jenkins infa team which has been merged.
> My origin is set as follows (g...@github.com:jenkinsci/slack-uploader-plugin.git) and I am able to push it normally. But I am not able to push it using ssh. I have added the username and password in the settings.xml file but to no avail. A proper head hurting moment. Please help.
>
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/433D8298-CFEC-430C-95DA-BBBFC0600A3B%40beckweb.net.

Daniel Beck

unread,
Oct 8, 2016, 5:25:12 AM10/8/16
to jenkin...@googlegroups.com

> On 08.10.2016, at 11:20, Baptiste Mathus <m...@batmat.net> wrote:
>
> I think your URL format is wrong.

It's basically https://github.com/jenkinsci/maven-hpi-plugin/blob/master/hpi-archetype/pom.xml#L56 but replacing the variable with the fixed plugin ID. I expect we'd see this much more often if the colon were wrong.

Shitij Goyal

unread,
Oct 8, 2016, 6:07:33 AM10/8/16
to Jenkins Developers
I have edited my settings.xml file. Here it is 
<settings>

  <pluginGroups>
    <pluginGroup>org.jenkins-ci.tools</pluginGroup>
  </pluginGroups>

  <profiles>
    <!-- Give access to Jenkins plugins -->
    <profile>
      <id>jenkins</id>
      <activation>
        <activeByDefault>true</activeByDefault> <!-- change this to false, if you don't like to have it on per default -->
      </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>
  </profiles>
  <mirrors>
    <mirror>
      <id>repo.jenkins-ci.org</id>
      <mirrorOf>m.g.o-public</mirrorOf>
    </mirror>
  </mirrors>

<servers>
    <server>
      <id>maven.jenkins-ci.org</id> <!-- For parent 1.397 or newer; before this use id java.net-m2-repository -->
      <username>{My jenkins account username}</username>
      <password>{My jenkins account password}</password>
    </server>
</servers>
</settings>

Still no luck.

Daniel Beck

unread,
Oct 8, 2016, 6:45:37 AM10/8/16
to jenkin...@googlegroups.com
What's the full mvn command line you're using?

Also, note that the repo ID in your pom.xml is repo.jenkins-ci.org, not maven.jenkins-ci.org.
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/01063bfc-2115-49d2-8094-6f972be54df1%40googlegroups.com.

Shitij Goyal

unread,
Oct 8, 2016, 9:37:06 AM10/8/16
to Jenkins Developers
I modified my settings.xml but the same error is coming. 
This is the command ->>> mvn -B release:prepare release:perform


On Saturday, October 8, 2016 at 2:01:34 PM UTC+5:30, Shitij Goyal wrote:

Shitij Goyal

unread,
Oct 8, 2016, 9:38:21 AM10/8/16
to Jenkins Developers
This command on its own also gives the same error which makes me think there's a problem with ssh. 

->>>>>git push ssh:********@github.com:jenkinsci/slack-uploader-plugin.git refs/heads/master:refs/heads/master


On Saturday, October 8, 2016 at 2:01:34 PM UTC+5:30, Shitij Goyal wrote:

Shitij Goyal

unread,
Oct 9, 2016, 3:21:23 PM10/9/16
to Jenkins Developers
Any suggestions please?


On Saturday, October 8, 2016 at 2:01:34 PM UTC+5:30, Shitij Goyal wrote:

Slide

unread,
Oct 9, 2016, 4:34:07 PM10/9/16
to Jenkins Developers

Are you on windows or a Unix variant? How did you setup your keys for github?


--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.

Shitij Goyal

unread,
Oct 10, 2016, 1:32:03 AM10/10/16
to Jenkins Developers
I am using a Mac machine. I followed this link : https://help.github.com/articles/generating-an-ssh-key/
I am able to push to the jenkinsci.slack-uploader repository without any problems.


On Saturday, October 8, 2016 at 2:01:34 PM UTC+5:30, Shitij Goyal wrote:

Shitij Goyal

unread,
Oct 10, 2016, 2:33:50 PM10/10/16
to Jenkins Developers
So, I was able to solve the problem of git. But a new error has cropped up.
Failed to deploy artifacts: Could not transfer artifact org.jenkins-ci.plugins:slack-uploader:hpi:1.3 from/to maven.jenkins-ci.org (http://maven.jenkins-ci.org:8081/content/repositories/releases): Connect to maven.jenkins-ci.org:8081 [maven.jenkins-ci.org/199.193.196.24] failed: Operation timed out.
Maven execution failed, exit code: '1'
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

Please help in the debugging! This occurs when the artifact is being uploaded. The hpi file seems to have uploaded but pom file is failing.

On Saturday, October 8, 2016 at 2:01:34 PM UTC+5:30, Shitij Goyal wrote:

Christopher Orr

unread,
Oct 10, 2016, 6:12:19 PM10/10/16
to jenkin...@googlegroups.com
Hi there,

On 10 Oct 2016, at 20:33, Shitij Goyal <goyal...@gmail.com> wrote:
So, I was able to solve the problem of git. But a new error has cropped up.
Failed to deploy artifacts: Could not transfer artifact org.jenkins-ci.plugins:slack-uploader:hpi:1.3 from/to maven.jenkins-ci.org (http://maven.jenkins-ci.org:8081/content/repositories/releases): Connect to maven.jenkins-ci.org:8081 [maven.jenkins-ci.org/199.193.196.24] failed: Operation timed out.
Maven execution failed, exit code: '1'
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

Please help in the debugging! This occurs when the artifact is being uploaded. The hpi file seems to have uploaded but pom file is failing.

Basically your POM looks a bit suspect — I’m not sure how you created it in the first place:
https://github.com/jenkinsci/slack-uploader-plugin/blob/aef07d9/pom.xml

The "maven.jenkins-ci.org:8081" URL indicates that you’re running into INFRA-588:

You’re using version 2.2 of the plugin parent POM, whereas you need to be using at least 2.5 (or the latest version: 2.17).

Furthermore:
- the file indentation and formatting is completely inconsistent,
- the <url> tag is commented out, meaning that the plugin won’t appear in the Update Centre (and the wiki page name should ideally be "Slack Uploader Plugin", rather than "Slack Uploader"),
- you have a <tag> defined in the <scm> section,
- there are references to Java 1.8, even although Jenkins plugins should ideally still support Java 1.7, and
- you have a reference to "hudson.plugin.version" which, for a brand new plugin, seems weird.

Regards,
Chris

Shitij Goyal

unread,
Oct 11, 2016, 1:36:36 AM10/11/16
to Jenkins Developers
Hi. Thank you for the pointers. I changed my pom.xml but a 401 error is coming. 
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project slack-uploader: Failed to deploy artifacts: Could not transfer artifact org.jenkins-ci.plugins:slack-uploader:hpi:1.5 from/to maven.jenkins-ci.org (https://repo.jenkins-ci.org/releases/): Failed to transfer file: https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/slack-uploader/1.5/slack-uploader-1.5.hpi. Return code is: 401, ReasonPhrase: Unauthorized.

I have updated my parent pom to 2.5.


On Saturday, October 8, 2016 at 2:01:34 PM UTC+5:30, Shitij Goyal wrote:

Ted Xiao

unread,
Oct 11, 2016, 3:49:46 AM10/11/16
to Jenkins Developers
Please verify the password in settings.xml is same as the encrypted password on repo

Make sure PW encryption is correct:

Shitij Goyal

unread,
Oct 11, 2016, 9:54:46 AM10/11/16
to Jenkins Developers
Hi, I followed your advice and copied the encrypted password to settings.xml. But still getting this error.
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project slack-uploader: Failed to deploy artifacts: Could not transfer artifact org.jenkins-ci.plugins:slack-uploader:hpi:1.6-20161011.135211-1 from/to maven.jenkins-ci.org (https://repo.jenkins-ci.org/snapshots/): Failed to transfer file: https://repo.jenkins-ci.org/snapshots/org/jenkins-ci/plugins/slack-uploader/1.6-SNAPSHOT/slack-uploader-1.6-20161011.135211-1.hpi. Return code is: 401, ReasonPhrase: Unauthorized.

This is my settings.xml. I am assuming the encrypted password to be ABC.
I am able to login to the account without any problem.

      <id>repo.jenkins-ci.org</id> <!-- For parent 1.397 or newer; before this use id java.net-m2-repository -->
      <username>masterlittle</username>
      <password>ABC</password>
    </server>
</servers>
</settings>

On Saturday, October 8, 2016 at 2:01:34 PM UTC+5:30, Shitij Goyal wrote:

Ted Xiao

unread,
Oct 11, 2016, 10:02:30 PM10/11/16
to Jenkins Developers, goyal...@gmail.com
You are using wrong server id in settings.xml, it should be <id>maven.jenkins-ci.org</id>, it is not the profile-> repositories->id
To verify the server id, run mvn help:effective-pom  and find distributionManagement section, I think it will show <id>maven.jenkins-ci.org</id>
Reply all
Reply to author
Forward
0 new messages