How to solve the Error with debug - logging : Cannot access 'io.gatling.gradle.JvmConfigurable.Trait.FieldHelper'? - gradle

How to solve the Error with debug - logging : Cannot access 'io.gatling.gradle.JvmConfigurable.Trait.FieldHelper'?
I need to check the log for performance execution on cursor based pagination scripts in jenkins.
but the build.gradle always shows error with log parameters such as at logHttp & logLevel
plugins {
id("scala")
id("io.gatling.gradle") version "3.9.0"
}
gatling {
logHttp = io.gatling.gradle.LogHttp.FAILURES
logLevel = "WARN"
}
repositories {
maven {
url = uri("https://repo1.maven.org/maven2/")
}
}
Error message :
Cannot access 'io.gatling.gradle.JvmConfigurable.Trait.FieldHelper'
which is a supertype of 'io.gatling.gradle.GatlingPluginExtension'.
Check your module classpath for missing or conflicting dependencies
Please help me solve this issue

Related

Adding a custom java library using gradle from gitlab with a provisioned deploy token

I got this working with my public github account where I was using something like this:
maven {
url "https://raw.githubusercontent.com/tvelev92/reactnativeandroidmaven/master/"
}
Then I decided I want it to be private and I put it on my company's gitlab and provisioned an access token however, I cannot figure out how to change build.gradle to accomplish a successful import of the pom file. Here is what I have however, I am receiving a 401 server response.
maven {
url "https://gitlabdev../../mobile/mysdk"
credentials(HttpHeaderCredentials) {
name = "password"
value = "..."
}
authentication {
header(HttpHeaderAuthentication)
}
}
please try:
url "https://raw.githubusercontent.com/tvelev92/reactnativeandroidmaven/raw/master/"

403 You are not permitted to execute the promotion 'snapshotToRelease'

I am trying to release a specific version via artifactory. Promoting to a release folder gives me a 403 error with below error:
{
"errors" : [ {
"status" : 403,
"message" : "You are not permitted to execute the promotion 'snapshotToRelease'."
} ]
}
Looking at the error it's a permission issue and I have tried most of the permissions for the user that tries to release the build but no luck. Below is the api resource I'm trying to execute
/api/plugins/build/promote/snapshotToRelease
I suppose you're using this plugin?
The way this promotion is configured, only the following users can run it:
Users with admin privileges
A user with the username "jenkins"
If neither of these describe the user in question, and you're allowed to edit the plugin file, you can change the code to work with other users:
snapshotToRelease(users: ["my-promoter"], params: ...) { buildName, buildNumber, params ->
// ...
}
Or any user in a group:
snapshotToRelease(groups: ["my-promote-group"], params: ...) { buildName, buildNumber, params ->
// ...
}
(See the documentation for more details.)

gradle error "Cannot convert the provided notation to a File or URI"

I have defined two system properties in gradle.properties:
systemProp.buildDir=build
systemProp.cfgDir=build\\cfg
And I have the following task defined in build.gradle:
task clean(group:'clean',description:'clean the project') << {
ant.sequential {
delete(dir: System.properties.buildDir)
mkdir(dir: System.properties.buildDir)
delete(dir: System.properties.cfgDir)
mkdir(dir: System.properties.cfgDir)
}
}
This generates the following error:
Execution failed for task ':clean'.
> Cannot convert the provided notation to a File or URI: {dir=build}.
The following types/formats are supported:
- A String or CharSequence path, e.g 'src/main/java' or '/usr/include'
- A String or CharSequence URI, e.g 'file:/usr/include'
- A File instance.
- A URI or URL instance.
But this equivalent block of code does not generate any error and works as expected:
task clean(group:'clean',description:'clean the project') << {
ant.delete(dir: System.properties.buildDir)
ant.mkdir(dir: System.properties.buildDir)
ant.delete(dir: System.properties.cfgDir)
ant.mkdir(dir: System.properties.cfgDir)
}
Is the error on the first syntax a bug in gradle, or am I missing something?
This error is caused by the fact that your Gradle build script delegates to an instance of the Project interface, which also has a method called delete, whose argument is evaluated by Project.file(). If you want to use the Ant task you'll have to qualify it with the ant prefix.

SonarQube Eclipse plugin : change default server configuration

I try to change the default SonarQube server value in SonarQube Eclipse plugin (v3.2)...
Using the pluginCustomization process (argument -pluginCustomization myPrefs.ini in eclipse.ini file), I add the same value as result of eclipse preferences export :
# SonarQube default configuration server
org.sonar.ide.eclipse.core/servers/http\:\\2f\\2fsonar.mycompany.org/auth=true
But after workspace creation, the default value is always http://localhost:9000
This is a bug ? or there is a best common way to do that ?
Thanks for the tips.
24/09/2015 Update : Fixed with SonarQube Eclipse plugin v3.5 (see SONARCLIPS-428).
It is not the answer but a trick ... if you consider :
Having your own plugin with some IStartup process in the Eclipse distribution
You are using a proxy with the same credentials as SonarQube
This code could help you in an earlyStartup() method :
// Plugin dependencies : org.sonar.ide.eclipse.core, org.eclipse.core.net
// Write a process to do this code once (IEclipsePreferences use)
// ...
String userName = null;
String password = null;
// Get first login/password defined in eclipse proxy configuration
BundleContext bc = Activator.getDefault().getBundle().getBundleContext();
ServiceReference<?> serviceReference = bc.getServiceReference(IProxyService.class.getName());
IProxyService proxyService = (IProxyService) bc.getService(serviceReference);
if (proxyService.getProxyData() != null) {
for (IProxyData pd : proxyService.getProxyData()) {
if (StringUtils.isNotBlank(pd.getUserId()) && StringUtils.isNotBlank(pd.getPassword())) {
userName = pd.getUserId();
password = pd.getPassword();
break;
}
}
}
// Configure SonarQube with url and proxy user/password if exist
SonarCorePlugin.getServersManager().addServer("http://sonarqube.mycompany.com", userName, password);
// Store process done in preferences
// ...

How to debug parameters sent in Grails

Grails is so nice to append the parameters sent to console output in the case of an error:
2011-05-23 12:17:05,173 [http-8080-5] ERROR errors.GrailsExceptionResolver - Exception occurred when processing request: [POST] / - parameters:
maps: on
maps: on
maps: on
maps:
_isPublic:
description: test
name: set1
isPublic: on
Stacktrace follows:
...
But how can I tell it to always show me which parameters are sent (like in Rails, for example)?
My current log4j configuration looks as follows:
error 'org.codehaus.groovy.grails.web.servlet', // controllers
'org.codehaus.groovy.grails.web.pages', // GSP
'org.codehaus.groovy.grails.web.sitemesh', // layouts
'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
'org.codehaus.groovy.grails.web.mapping', // URL mapping
'org.codehaus.groovy.grails.commons', // core / classloading
'org.codehaus.groovy.grails.plugins', // plugins
'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
'org.springframework',
'org.hibernate',
'net.sf.ehcache.hibernate'
warn 'org.mortbay.log'
I don't believe Grails itself supports logging the request parameters for each request. However, you can easily implement this yourself in a filter:
package com.example
class MyFilters {
private static final log = org.apache.commons.logging.LogFactory.getLog(this)
def filters = {
paramLogger(controller:'*', action:'*') {
before = {
log.debug "request params: $params"
}
}
}
}
Remember to enable debug logging for this filter in `Config.groovy by adding
debug com.example
to the log4j closure
You probably want to get more output from org.codehaus.groovy.grails.web so set that one to a lower level (debug or trace)

Resources