Jenkins upload artifact to nexus plugin not working with Nexus 3 - jenkins

I have a Jenkins project that does a gradle build and uploads build artifacts to a Nexus maven hosted repository using the Jenkins upload artifact to nexus plugin. This was working fine when I was using Nexus 2.13 - but after upgrading to Nexus 3, the upload to Nexus is no longer working. I have made sure that I have configured Nexus 3 repository just like my Nexus 2.13 repository. When I build my Jenkins project I get a response
GroupId: com.company
ArtifactId: hello-world-util
Version: 1.0.0
File: hello-world-util-1.0.0.jar
Repository:companyDevops
Uploading artifact hello-world-util-1.0.0.jar started....
Reason Phrase: Method Not Allowed
<!DOCTYPE html>
<html>
<head>
<title>405 - Nexus Repository Manager</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<!--[if lt IE 9]>
<script>(new Image).src="http://192.168.99.100:18081/favicon.ico?3.0.1-01"</script>
<![endif]-->
<link rel="icon" type="image/png" href="http://192.168.99.100:18081/favicon-32x32.png?3.0.1-01" sizes="32x32">
<link rel="mask-icon" href="http://192.168.99.100:18081/safari-pinned-tab.svg?3.0.1-01" color="#5bbad5">
<link rel="icon" type="image/png" href="http://192.168.99.100:18081/favicon-16x16.png?3.0.1-01" sizes="16x16">
<link rel="shortcut icon" href="http://192.168.99.100:18081/favicon.ico?3.0.1-01">
<meta name="msapplication-TileImage" content="http://192.168.99.100:18081/mstile-144x144.png?3.0.1-01">
<meta name="msapplication-TileColor" content="#00a300">
<link rel="stylesheet" type="text/css" href="http://192.168.99.100:18081/static/css/nexus-content.css?3.0.1-01"/>
</head>
<body>
<div class="nexus-header">
<a href="http://192.168.99.100:18081">
<div class="product-logo">
<img src="http://192.168.99.100:18081/static/images/nexus.png?3.0.1-01"/>
</div>
<div class="product-id">
<div class="product-id__line-1">
<span class="product-name">Nexus Repository Manager</span>
</div>
<div class="product-id__line-2">
<span class="product-spec">OSS 3.0.1-01</span>
</div>
</div>
</a>
</div>
<div class="nexus-body">
<div class="content-header">
<img src="http://192.168.99.100:18081/static/rapture/resources/icons/x32/exclamation.png?3.0.1-01"/>
<span class="title">Error 405</span>
<span class="description">Method Not Allowed</span>
</div>
<div class="content-body">
<div class="content-section">
HTTP method POST is not supported by this URL
</div>
</div>
</div>
</body>
</html>
My Jenkins nexus upload is configured like (and this has not changed between Nexus 2.13 and 3)
Upload artifact to nexus
Nexus Details
Protocol HTTP
Nexus URL 192.168.99.100:18081
User admin
Password admin123
Credentials com.company
GroupId com.company
ArtifactId hello-world-ui
Version 1.0.0
Packaging jar
Repository companyDevops
File build/libs/hello-world-util-1.0.0.jar
My Nexus 3 maven hosted repository is configured like
Name companyDevops
Format maven2
Type hosted
URL http://192.168.99.100:18081/repository/companyDevops/
Online
Maven 2
Version policy Release
Layout policy Strict
Storage
Blog store default
Strict content type validation X
Hosted
Deployment policy Allow redeploy
Not sure why I’m getting this error
-I’ve validated that the Nexus admin user has permission to upload artifacts
-I’ve validated that allow redeploy is enabled
What might be happening
-possibly the Jenkins ‘upload artifact to nexus’ plugin is not compatible with Nexus 3?
Has anyone got this to work with Nexus 3? Any suggestions?
Thanks!

Nexus Artifact Uploader plugin now supports Nexus-2.x & Nexus-3.x.
Support for Nexus-3.x with plugin version 2.6
https://wiki.jenkins-ci.org/display/JENKINS/Nexus+Artifact+Uploader

Please use "Nexus Artifact Uploader", below is the url and also support nexus 3 as well.
https://plugins.jenkins.io/nexus-artifact-uploader
After the installation of plugin, we would get nexus artifact uploader in build section.

This plugin doesn't support Nexus-3.x, We are working to provide capability uploading artifacts to Nexus-3.x

Related

How to get access the corporate docker hub inside docker-in-docker?

I have a corporate proxy and docker registry(nexus). When I execute the command:
docker login -u <corporate_login> -p <pass> https://nexus-corporate.com,
I get a successful connection. But when I use docker-in-docker image and execute a similar command, there are problems with proxy. How to solve problem?
Error message:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta type="copyright" content="Copyright (C) 1996-2018 The Squid Software Foundation and contributors">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ERROR: The requested URL could not be retrieved</title>
<style type="text/css"><!--
/*
* Copyright (C) 1996-2018 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
* Please see the COPYING and CONTRIBUTORS files for details.
*/
/*
Stylesheet for Squid Error pages
Adapted from design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
*/
.....
body
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }
:lang(he) { direction: rtl; }
--></style>
</head><body id=ERR_ACCESS_DENIED>
<div id="titles">
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
</div>
<hr>
<div id="content">
<p>The following error was encountered while trying to retrieve the URL: http://docker:2375/v1.40/auth</p>
<blockquote id="error">
<p><b>Access Denied.</b></p>
</blockquote>
<p>Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.</p>
<p>Your cache administrator is admin#my_company.com.</p>
<br>
</div>
<hr>
<div id="footer">
<p>Generated Mon, 27 Jan 2020 08:39:45 GMT by proxy.my_company_domain (squid/4.4)</p>
<!-- ERR_ACCESS_DENIED -->
</div>
</body></html>

Can not access the images from the webapp folder in Grails 3

I'm using grails 3.2.7 application and I can't access the images in the webapp folder
I tried to set some images in the auth.gsp (spring-security-core) But it is not getting displayed.
Here is the code
<img height="100" width="252"style="background-color: #556a7f"
src="${resource(dir: 'images', file: 'Standout-Logo-2.png')}"
class="img-responsive" alt="Utility Application" />
Can someone help?
Here is the folder structure

AppCache html5, modifying the manifest file does not update the content of index.html?

From this link, it says :
Once an application is cached, it remains cached until one of the
following happens:
The user clears the browser's cache
The manifest file is modified (see tip below)
The application cache is programmatically updated
Following the instruction from the internet, for the manifest file I use a version number. When I change the content of the index.html with 01.jpg to 02.jpg - I also changed the version number of the manifest file.
With the steps above, it works within my Win7 Wamp Server Local Host. But once I do the same steps in my web server (after uploading the file to the web server) - it doesn't work.
Can somebody please help me what did I do wrong ?
Document was loaded from Application Cache with manifest http://www.example.com/test/offline.appcache
Application Cache Checking event
Navigated to http://www.example.com/test/
Application Cache NoUpdate event
Above is from the Chrome browser console after I modified the version number of the manifest file (from #01 to #02) and the jpg file (from 01.jpg to 02.jpg) in the index.html file.
The offline.appcache CACHE file list no change, except the version number :
CACHE MANIFEST
# 2017-03-25 version#01
uploads/event.jpg
uploads/baby.jpg
/favicon.ico
NETWORK:
indexPHP.php
The index.html file :
<!DOCTYPE html>
<html manifest="offline.appcache">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style></style>
</head>
<body>
<img src="uploads/01.jpg">
</body>
</html>
<script type="text/javascript">
function onUpdateReady() {
alert("offline files will be updated");
window.location.reload();
}
window.applicationCache.addEventListener('updateready', onUpdateReady);
if(window.applicationCache.status === window.applicationCache.UPDATEREADY) {
onUpdateReady();}
</script>
the .htaccess file :
AddType text/cache-manifest .appcache
the "tree" :
example.com/.htaccess
example.com/favicon.ico
example.com/test/index.html
example.com/test/offline.appcache
example.com/test/uploads/01.jpg
example.com/test/uploads/02.jpg
Thank you in advanced.

Missing files (404) in Ionic App only in iOS

I have an app I developed in Android. I installed a VM with Mac, and I'm testing it in iOS. The app worked perfectly in Android, but in iOS it is not. When I use 'ionic serve' or 'ionic serve --lab' the browser show a white screen, and in the console I get this errors (link of image below):
Console
Here is some code from the index.html:
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="lib/ionic/css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/bluebird.min.js"></script>
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ionic.cloud.min.js"></script>
<script src="lib/ionic/js/ionic-modal-select.min.js"></script>
<script src="lib/ionic/js/ionic-toast.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="js/ng-cordova.min.js"></script>
<script src="cordova.js"></script>
I'm really lost here because the exact same files works OK for Android.
Which error you are posted, not library error.Error coming from app.js file.If you dont mind create a new ionic app and replace your file in new app.it will works.

Nokogiri not reading/parsing structure of HTML file in CentOS

I've written a script to parse out some needed code in HTML files that are uploaded to our app. On OS X, this process works fine. However, when I upload to our testing server, it doesn't. When I go into the console on the test server and attempt to parse the file, Nokogiri won't see the structure - each time I get a single line of output instead of the whole document structure. The rest of my script isn't being executed because Nokogiri isn't traversing the document. Looking for some help on how to resolve the issue.
Here's the requisite code I'm using to open the file and feed it to Nokogiri:
html = Nokogiri::HTML(File.open("index.html", "r"))
Here's what html equates to:
#<Nokogiri::HTML::Document:0x10d9bbf0 name="document" children=[#<Nokogiri::XML::DTD:0x10d9b81c name="html">]>
In OS X, I get the entire tree, as expected.
Here's the contents of index.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" href="zero.css" type="text/css" charset="utf-8" />
</head>
<body class="fullpage-vert" onunload="javascript:clearInterval(audioLoop);">
<div id="container">
<div id="danceHolder">
<img id="danceVid" src="1-1.jpg" width="320" height="480" alt="" />
</div>
<div id="introHolder">
<img id="introVid" src="0-1.jpg" width="320" height="480" alt="" />
<div id="ctabg"></div>
<div id="cta1"></div>
<div id="cta2"></div>
<div id="cta3"></div>
<div id="phone"></div>
<div id="logo"></div>
</div>
</div>
bridge test
<frameset cols="25%,75%">
<frame src="frame_a.htm" />
<frame src="frame_b.htm" />
</frameset>
</body>
</html>
When I try and search for the frameset, for example, I get nothing:
html.css("frameset").size
0
I know Nokogiri has problems with the default Libxml2 version installed on CentOS (2.6.2), but I've followed the instructions to get it built on a new version (2.7.8). Here's the output for nokogiri -v:
# Nokogiri (1.5.0)
---
warnings: []
nokogiri: 1.5.0
ruby:
version: 1.9.2
platform: x86_64-linux
description: ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
engine: ruby
libxml:
binding: extension
compiled: 2.7.8
loaded: 2.7.8
Has anyone else seen behavior like this?
For some reason, swapping
html = Nokogiri::HTML(File.open("index.html", "r"))
for
html = Nokogiri::HTML(File.read("index.html"))
works, although now it won't calculate line numbers properly (everything is line number 0).

Resources