I have some "go" code as part of a larger project in a subdir.
I have a .gitlab-ci.yml and the "Security/SAST.gitlab-ci.yml" template enabled.
In that subdir, 'gosec ./...' runs fine but not under gitlab SAST because it starts in the project root. So my use case is looking for a way to get it to 'cp' that subdir to '/go/src/app' instead of the whole project.
...
$ /analyzer run
[INFO] [Gosec] [2022-08-28T09:25:49Z] ▶ GitLab Gosec analyzer v3.5.5
DEBU] [Gosec] [2022-08-28T09:25:49Z] ▶ /bin/cp -r /builds/group11392/project1 /go/src/app
[INFO] [Gosec] [2022-08-28T09:25:49Z] ▶ Fetching dependencies...
[ERRO] [Gosec] [2022-08-28T09:25:49Z] ▶ /usr/local/go/bin/go get -d ./...
go: go.mod file not found in current directory or any parent directory.
...
I'm using the avast /
gradle-docker-compose-plugin - https://github.com/avast/gradle-docker-compose-plugin in my project here - https://github.com/johnnyalpha8/Pet-Shop/blob/main/build.gradle.kts .
My project is a SpringBoot Kotlin API.
I believe I have configured the plugin correctly. I have added it to the plugins block of my build.gradle.kts -
plugins {
...
id("com.avast.gradle.docker-compose") version "0.15.2"
}
Now when I try out the new task ./gradlew composeUp the container starts up just fine, but then immediately shuts down and the build fails with -
Starting process 'command 'docker-compose''. Working directory: /home/charliejade/dev/apps/reactiveKotlin-source-code Command: docker-compose --no-ansi -p 649e9eedea35a6b45cffd19a30f272cd_reactiveKotlin_ config --services
Successfully started process 'command 'docker-compose''
Starting process 'command 'docker-compose''. Working directory: /home/charliejade/dev/apps/reactiveKotlin-source-code Command: docker-compose --no-ansi -p 649e9eedea35a6b45cffd19a30f272cd_reactiveKotlin_ ps --services
Successfully started process 'command 'docker-compose''
List containers.
Usage: ps [options] [SERVICE...]
Options:
-q Only display IDs
Starting process 'command 'docker-compose''. Working directory: /home/charliejade/dev/apps/reactiveKotlin-source-code Command: docker-compose --no-ansi -p 649e9eedea35a6b45cffd19a30f272cd_reactiveKotlin_ config --services
Successfully started process 'command 'docker-compose''
Starting process 'command 'docker-compose''. Working directory: /home/charliejade/dev/apps/reactiveKotlin-source-code Command: docker-compose --no-ansi -p 649e9eedea35a6b45cffd19a30f272cd_reactiveKotlin_ stop --timeout 10 myservice mariadb
Successfully started process 'command 'docker-compose''
Stopping 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_mariadb_1 ...
Stopping 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_myservice_1 ...
Stopping 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_myservice_1 ... done
Stopping 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_mariadb_1 ... done
Starting process 'command 'docker-compose''. Working directory: /home/charliejade/dev/apps/reactiveKotlin-source-code Command: docker-compose --no-ansi -p 649e9eedea35a6b45cffd19a30f272cd_reactiveKotlin_ down --volumes
Successfully started process 'command 'docker-compose''
Removing 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_mariadb_1 ...
Removing 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_myservice_1 ...
Removing 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_myservice_1 ... done
Removing 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_mariadb_1 ... done
Removing volume 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_mariadb_data
> Task :composeUp FAILED
:composeUp (Thread[Execution worker for ':',5,main]) completed. Took 1 mins 18.015 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':composeUp'.
> Exit-code 1 when calling docker-compose, stdout:
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 19s
Gradle Scan - https://scans.gradle.com/s/ealbm2cysvi42
Full debug logs with stacktrace can be found here - https://github.com/johnnyalpha8/Pet-Shop/issues/1
I am using -
Linux Mint 19.3 Tricia as my OS.
Kotlin v1.6.20
docker-compose version 1.17.1
I should add that my services start correctly when done manually with docker-compose up docker-compose.yml. My docker-compose.yml file has two services, mariadb + my Kotlin REST API. I've tried ./gradlew composeUp with just mariadb in the docker-compose file and I get the same result.
Feel free to checkout the code from here - https://github.com/johnnyalpha8/Pet-Shop and try it out for yourself :(
I am quite stumped, but don't want to give up on the plugin just yet :)!
Any insight into what is wrong would be appreciated!
i'd like to add the own servlets by starting of selenium-server-standalone-2.19.0.jar -servlets, but cannot figure out how to do it.
is it possible to find the developer's guide about selenium2 servlets?
one example would be also very nice.
tnx a lot!
a working solution of mine:
1) checkout of http://selenium.googlecode.com/svn/tags/selenium-2.19.0
2) created HubServlet which extends from RegistryBasedServlet
package org.openqa.grid.web.servlet.alpha;
...
public class HubServlet extends RegistryBasedServlet {
...
}
3) building
./go clean release (only once)
./go //java/server/src/org/openqa/grid/selenium:selenium:uber (everytime i change something on org.openqa.grid.web.servlet.alpha.HubServlet)
The solution which worked for me:
svn checkout of the selenium2 sources from googlecode
$ svn co http://selenium.googlecode.com/svn/tags/selenium-2.19.0 selenium
changed to the selenium dir
$ cd selenium
adding servlets folder "alpha"
$ mkdir -p java/server/src/org/openqa/grid/web/servlet/alpha
adding servlets classe(s)
package org.openqa.grid.web.servlet.alpha;
public class HubServlet extends RegistryBasedServlet {
...
}
making HubServlet.jar
$ ./go clean //java/server/src/org/openqa/grid/web/servlet/alpha:HubServlet
getting from googlecode selenium-server-standalone-2.19.0.jar
$ wget http://selenium.googlecode.com/files/selenium-server-standalone-2.19.0.jar -O selenium-server-standalone-2.19.0.jar
merging jar(s)
$ mkdir tmp
$ (cd tmp; jar -xf "build/java/server/src/org/openqa/grid/web/servlet/alpha/HubServlet.jar")
$ (cd tmp; jar -xf selenium-server-standalone-2.19.0.jar)
$ jar -cfM selenium-server-standalone.jar -C $dir_sel_build/tmp .
starting selenium-server-standalone.jar with the "-servlets" parameter
$ java -jar selenium-server-standalone.jar -role hub -servlets org.openqa.grid.web.servlet.alpha.HubServlet
you will see something like:
15.03.2012 16:25:07 org.openqa.grid.selenium.GridLauncher main
INFO: Launching a selenium grid server
15.03.2012 16:25:08 org.openqa.grid.web.Hub <init>
INFO: binding org.openqa.grid.web.servlet.alpha.HubServlet to /grid/admin/HubServlet/*
361 [main] INFO org.seleniumhq.jetty7.server.Server - jetty-7.x.y-SNAPSHOT
392 [main] INFO org.seleniumhq.jetty7.server.handler.ContextHandler - started
o.s.j.s.ServletContextHandler{/,null}
400 [main] INFO org.seleniumhq.jetty7.server.AbstractConnector - Started
SocketConnector#0.0.0.0:4444
I was wondering if it was possible to modify the output from maven to for example hide the lines that start with [INFO] or to be able to see lines that start with [DEBUG]?
I don't think there is a way to configure it as a logger but mvn -q hides the [INFO] lines and mvn -X shows the debug messages.
Update in 2015: newer versions of maven have added a config file where this is finally possible although as a global per install configuration, check on your $mavenInstallationDir/conf/logging/simplelogger.properties if the file doesn't exist then your maven version is probably too old, I believe it was added on the 3.1 release
You can activate debug output using -X or --debug. For example:
mvn -X install
You can hide INFO messages using -q or --quiet. For example:
mvn -q install
try grepping the output, e.g.
mvn help:evaluate -Dexpression=project.version | grep -v "^\["
From their own docs, you want this:
RESULT=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo $RESULT
For reference, see: https://maven.apache.org/plugins/maven-help-plugin/evaluate-mojo.html#forceStdout
I'm trying to deploy an artifact to a remote repository accessible via scp and having a problem with repeated password prompts. My settings.xml contains this fragment:
<servers>
<server>
<id>example.com</id>
<username>myusername</username>
<password>mypassword</password>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
<configuration>
</configuration>
</server>
</servers>
The command line interaction looks like this:
$ mvn deploy:deploy-file -Dfile=ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dpackaging=jar -Dversion=11.2.0.1.0 -DrepositoryId=example.com -Durl=scp://example.com/maven2/
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'deploy'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [deploy:deploy-file] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [deploy:deploy-file {execution: default-cli}]
Keyboard interactive required, supplied password is ignored
Password: : mypassword
Uploading: scp://example.com/maven2//com/oracle/ojdbc6/11.2.0.1.0/ojdbc6-11.2.0.1.0.jar
2061K uploaded (ojdbc6-11.2.0.1.0.jar)
[INFO] Retrieving previous metadata from example.com
Keyboard interactive required, supplied password is ignored
Password: : mypassword
[INFO] repository metadata for: 'artifact com.oracle:ojdbc6' could not be found on repository: example.com, so will be created
[INFO] Uploading repository metadata for: 'artifact com.oracle:ojdbc6'
Keyboard interactive required, supplied password is ignored
Password: : mypassword
[INFO] Uploading project information for ojdbc6 11.2.0.1.0
Keyboard interactive required, supplied password is ignored
Password: : mypassword
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 30 seconds
[INFO] Finished at: Thu Sep 02 13:03:33 CEST 2010
[INFO] Final Memory: 5M/90M
[INFO] ------------------------------------------------------------------------
There are several problems here:
I'm prompted for a password even though it is is specified in the settings.xml
The password is echoed back on the console
It does not remember the password and instead asks me 4 times.
How can I configure maven so it either uses a password from settings.xml or asks me once without echoing my password to the screen?
Edit: This was on Ubuntu linux, a collegue just reproduced the same problem on Windows XP. As mounting the repository to a local path is not an option on Windows, I'm still looking for a solution.
I found the following on the maven-users list:
the sshd on the server used PasswordAuthentication no. After
switching to yes my maven config works fine.
Have you set either the repositoryId in your pom to use the correct server entry from the settings.xml, cause it looks like you don't set that so it uses the id: remote-repository. or did you changed the settings.xml accordingly.
As a workaround, I'm currently mounting the remote repository using sshfs and then using a file url in the maven command:
$ sudo adduser jh fuse
$ sudo mkdir -p /mnt/example.com/maven2
$ sudo chown -R jh:jh /mnt/example.com
$ sshfs username#example.com:/maven2 /mnt/example.com/maven2
$ mvn deploy:deploy-file -Dfile=ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dpackaging=jar -Dversion=11.2.0.1.0 -Durl=file:///mnt/example.com/maven2/repository/
Configuring the server in settings.xml is not needed in this case, the repositoryId need not be specified on the command line and I can use shell autocompletion on the file url.
I would still be interested if anyone can reproduce the problem or suggest a solution using maven standards.
We have since installed Nexus as an repository manager and are using the web interface to upload third party jars.
I don't have an exact solution, but at least the following works:
Create a server entry in the file ~/.m2/settings.xml:
<server>
<id>example-dist</id>
<username>myusername</username>
<password>ignored</password>
</server>
Perform the deploy or deploy:deploy-file as follows:
mvn deploy -DrepositoryId=example-dist
You'll be asked for the password for the supplied username - the password in the settings.xml is ignored.
If you don't want to supply passwords each time, you can do so by generated a ssh key using ssh-keygen. The generated public key you'll have to store in the authorized_keys files at the distribution server (for a better explanation, see several tutorials on the web or the man page).
This bug seems related.
http://jira.codehaus.org/browse/WAGON-323
Im am getting the message "Keyboard interactive required, supplied password is ignored" - even with wagon-ssh-2.4.
Tried to set <interactiveMode>false</interactiveMode> but then auth fails right away.
As per #Gerbrand's response, you can skip providing user credentials with ssh keys. The steps are the following:
If you do not have one yet, generate a private/public key pair with ssh-keygen. Let's say you store the private key in /home/user/.ssh/id_rsa
Copy the public key to the destination server with ssh-copy-id -i /home/user/.ssh/id_rsa USER#serverhostname
Change your settings.xml to use your keys instead of password
<server>
<id>serverhostname</id>
<username>USER</username>
<privateKey>${user.home}/.ssh/id_rsa</privateKey>
<!-- Note there is no password tag specified -->
</server>
Next time you need to login to the server via Maven, no password will be requested.