Comments (10)
Hello,
I have the same issue on node:12-alpine in gitlab-ci pipeline.
I run in before_script to run once who failed every time just to install it:
before_script:
- apk --update add openjdk8-jre
- npm run sonar || echo 'Sonar fail'
- sed -i 's/use_embedded_jre=true/use_embedded_jre=false/g' /root/.sonar/native-sonar-scanner/sonar-scanner-4.4.0.2170-linux/bin/sonar-scanner
script:
- npm run sonar
It works but it's very ugly.
Can you just put an args to set by le command line the boolean value of use_embedded_jre in sonar-scanner (sh & bat) script.
To launch the cmd like this : npm run sonar -Duse_embedded_jre=false
Actually the value is hard coded :
set use_embedded_jre=true
if "%use_embedded_jre%" == "true" (
set "JAVA_HOME=%SONAR_SCANNER_HOME%\jre"
)
if not "%JAVA_HOME%" == "" goto foundJavaHome
Thanks,
Edo
from sonar-scanner-npm.
Has there been any follow up on this? I am still having this issue on node alpine
from sonar-scanner-npm.
Thank you, Edo (@epelaic), I have improved your sed a little bit:
set -- /root/.sonar/native-sonar-scanner/* && sed -i 's/use_embedded_jre=true/use_embedded_jre=false/g' "$1/bin/sonar-scanner"
Warning! Do not thinkless copy-paste, I'm not any good Shell-developer.
from sonar-scanner-npm.
@bellingard the readme says:
sonarqube-scanner makes it very easy to trigger SonarQube / SonarCloud analyses on a JavaScript code base, without needing to install any specific tool or (Java) runtime.
It looks like this is not true, it does not work without a java runtime.
from sonar-scanner-npm.
The link in the comment above is dead, but i found this docker image that fixes the issue for alpine by installing glibc
:
https://github.com/Docker-Hub-frolvlad/docker-alpine-glibc/blob/master/Dockerfile
from sonar-scanner-npm.
Hello again everyone,
Thanks for bringing this up. I created a list of potential improvements and mentioned this topic:
I'll close this issue for now. Feel free to reopen if you want to create a PR ;)
from sonar-scanner-npm.
Hey, have you found a fix / workaround for this one?
from sonar-scanner-npm.
I ended up creating a new Dockerfile with Java installed. You'll have do download the jdk from Oracle.
ENV JAVA_HOME /opt/java/current
ENV PATH $PATH:/opt/java/current/bin
COPY packages/jdk-8u212-linux-x64.tar.gz /opt/java/jdk-8u212-linux-x64.tar.gz
# Oracle Java - https://wiki.alpinelinux.org/wiki/Installing_Oracle_Java
RUN ( \
cd /opt/java; \
tar -zxvf jdk-8u212-linux-x64.tar.gz;\
rm jdk-8u212-linux-x64.tar.gz; \
chown -R root.root jdk1.8.0_212/; \
ln -s jdk1.8.0_212 /opt/java/current; \
printf "export JAVA_HOME=/opt/java/current\nexport PATH=$PATH:\$JAVA_HOME/bin\n" > /etc/profile.d/java.sh; \
which paxctl || apk add paxctl; \
cd ./current/bin; \
paxctl -c java; \
paxctl -m java; \
paxctl -c javac; \
paxctl -m javac; \
)
It would be nice if Java wasn't needed though.
from sonar-scanner-npm.
Ah ok: #59 (comment)
from sonar-scanner-npm.
Hey @fabb, would like to contribute a small PR for the readme?
from sonar-scanner-npm.
Related Issues (20)
- NPM Sonar Scanner fails to run on Jenkins CI (UNIX)
- Add option for mirror for sonar plugins HOT 2
- Scan only the files which are required HOT 2
- Error: Basic authentication must be done with auth option HOT 3
- Setting trustStore/keyStore path
- Moderate Vulnerability in sonarqube-scanner > download > got HOT 10
- customScanner broken / calls own shell script `sonar-scanner` HOT 8
- ERROR: Caused by: Line 5 of report refers to a file with an unknown language (TypeScript file) HOT 3
- Java Runtime Environment Crashes Analysis HOT 2
- package calling sonar-project.properties instead of sonar-scanner.properties
- 2.8.2 can't download via proxy HOT 5
- v2.8.2 breaks bitbucket pipelines build HOT 7
- Sonar issue analyse parameter is set to the wrong value
- Allow users to use scanner asynchronously HOT 4
- Security issue of [email protected] in sonarqube-scanner dependency HOT 3
- Request Release 2.8.3 HOT 2
- Pinned: improvements
- Node 8 execution broke HOT 2
- Fails to download executables HOT 1
- The 2.9.x release is a breaking change on Java 8 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonar-scanner-npm.