Gradle wrapper authenticated download credentials not being picked up from environment - gradle

Using gradle wrapper and specifying an internal repository URL to download the zip distribution - I followed the instructions from here: https://docs.gradle.org/5.2.1/userguide/gradle_wrapper.html#sec:authenticated_download
The https\://<username>:<password>#... in the distributionUrl works fine, but it's sub-optimal - we don't want credentials checked in source control. I tried:
systemProp.gradle.wrapperUser=<username>
systemProp.gradle.wrapperPassword=<password>
and confirmed that the properties are being set; however, they seem to be completely ignored. I keep getting a 401 unauthorized error when trying to access our internal repository. I tried all possibile combinations: systemProp.gradle.wrapperUser=username, gradle.wrapperUser=username and wrapperUser=username, nothing seems to work.
Any help is much appreciated.

Well, it turns out the issue was not with Gradle, but with IntelliJ, which seems to be overriding or completely ignoring the properties above. From a Unix shell script, everything works as advertised.

Related

Why do I need to log in to Github

Because xlsx tag v1.1.0 does not contain the latest features, I use the following command to update the xlsx package to master
# go get github.com/bingoohuang/xlsx#master
Username for 'https://github.com':
Why do I still need to login to download the github public code, this does not happen when I download packages from other go get
The strange thing is that I can execute it on windows, but the above login question occurs on centos7.
what caused this to happen? I really appreciate any help with this.
It looks like github.com/bingoohuang/xlsx#master depends on github.com/bingoohuang/go-yaml, which either does not exist or is private.
Because GitHub responds with a 404 error for private repositories, it is likely this missing repository is causing go get to issue a password prompt.
A go get for a library without missing dependencies (e.g., go get github.com/rs/zerolog#master) works without a problem.

Sonar rest API insufficient privileges

I can't access most of the Sonar API, for example
localhost:9000/api/tests/show?key=htmlparser:/src/test/java/HtmlParserTest.java
or see api/sources/scm. api/server/system and some other general stuff works but nothing where I actually see the code.
I always get a
{"errors":[{"msg":"Insufficient privileges"}]}
I set the project permissions to let anyone see source code & browse the porject, I tried it with Postman, a Java HttpRequest, the command line ...
curl -u admin:admin localhost:9000/api/tests/show?key=htmlparser:/src/test/java/HtmlParserTest.java
I checked with SonarQube 5.1 and 4.5.1. I've found a posts with the same issue but have yet to find a fix. Does anyone have a solution idea?
Thanks for your help
SOLUTION
It was a syntax error (even though the message said Insufficient privileges). The correct call would be:
localhost:9000/api/tests/show?key=htmlparser:htmlparser:src/test/java/HtmlParserTest.java
If you are not sure what goes before the "src/..." don't worry. You can get it by calling api/projects/index and looking at the attribute named "k".

Xcode setting up for git repository hung

I was trying to set up my Xcode 5 connecting to my github repository. The procedure stopped like this
It could never get through it. What else can I do to get it done? Thanks!
I ran into the same issue, and it turned out to be because I was using a lowercase username in the URL when my actual GitHub username is mixed-case (!). It seems that missing or invalid credentials sometimes simply cause it to hang on the "Verifying" step.
This is a long shot, but go to your GitHub profile and double-check the actual case of your username. Also try copying the clone URL from GitHub's web page for the repository, then adding the (username)# portion, to make sure there are no typos in your URL.

GCM: java.lang.NoClassDefFoundError: com/google/android/gcm/server/Sender

I have been trying to get Google Cloud Messaging to work in eclipse. I was able to compile the example given on their demo webpage and run that without any errors; however, when I try to create my own example using jersey I get the run time error "java.lang.NoClassDefFoundError: com/google/android/gcm/server/Sender" when the following code tries to create a sender.
#POST
#Path("/send")
public Response sendMessage() throws IOException
{
Sender sender = new Sender("api_key");
Message message = new Message.Builder().build();
sender.send(message, DataStore.getDevices(), 5);
return Response.status(200).entity("Success").build();
}
Note: I have replaced my real api key with api_key. I know it works because I was able to get the demo working by running the ant commands explained in the tutorial. Also just to be specific in case of ambiguity, the error I am getting is server side, and has nothing to do with the android device.
Things I have already tried:
I have included the gcm-server.jar in my WEB-INF/lib folder and under project properties I have included it in the build path.
I have also tried, as mentioned on other sites, to include json_simple-1.1.jar the same way I included gcm-server.jar. I don't see how this would effect this error but I saw this listed as an answer in a few different places.
(Solution) Deleted the tomcat server and created a new one. I probably could have just cleaned the project instead and had the same results.
Demo tutorial link: http://developer.android.com/guide/google/gcm/demo.html.
I just found a solution to my problem. In frustration I deleted the old Tomcat server from eclipse and created a new one. When I ran the project again there weren't any problems at all. When I first set up the project I had included the jar files in WEB-INF/lib and later, after reading a lot of posts on the internet, added gcm-server.jar to the build path. It appears that this action would have fixed it but for some reason unknown to me there were some left over files on the server from before the change. I should have tried cleaning my project but I didn't even think about that being the issue. Anyway, I hope that this helps someone because I've sort of condensed all of the information I could find on the internet into this post, as well as included my own dilemma and solution to it.

Spring security login error

I just implemented a simple login functionality using spring it how ever worked with the eclipse in built browser but gives the following error in chrome and firefox.
HTTP Status 404 - /SpringLogin/welcome.jsp;jsessionid=8332D4F3D4709DCA37C87F30F1EA03D5
The requested resource (/SpringLogin/welcome.jsp;jsessionid=BEE789093FF79CB6B67F8DA368E8B3E4) is not available.
can you please tell me why it is happening?
PS: I have two projects SpringLogin and both of them had same project names and both had similar packages. Then neither of the projects worked properly and gave the above error. How ever after I created another project with a different name and using different package names, it worked like magic. I am guessing here that it may have been the problem. But what is the logical answer that'll explain what happened there?
you don't have being calling the correct URL
it seems that the context /SpringLogin/ does not exists anymore.
Try /welcome.jsp or if you changed the name of application - try /newappname/welcome.jsp

Resources