./mvnw stuck at "[INFO] Scanning for projects..." on azure vm - azure

I have cloned a jhipster porject in an Azure virtual machine and tried to lauch it using ./mvnw
However, despite working on my pc, this command does not seem to do so on this vm and remains stuck at "[INFO] Scanning for projects..." until it is killed by the vm:
$ ./mvnw
[INFO] Scanning for projects...
Killed
With -X, I get:
$ ./mvnw -X
Apache Maven 3.6.2 (...)
Maven home: /home/ecomg219/.m2/wrapper/dists/apache-maven-3.6.2-bin/795eh28tki48bv3l67maojf0ra/apache-maven-3.6.2
Java version: 11.0.4, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.0.0-1023-azure", arch: "amd64", family: "unix"
[DEBUG] Created new class realm maven.api
...
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /home/ecomg219/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project com.ecom.app:ecom:jar:0.0.1-SNAPSHOT: (none)
[DEBUG] Looking up lifecycle mappings for packaging jar from ClassRealm[plexus.core, parent: null]
[DEBUG] Resolving plugin prefix spring-boot from [org.apache.maven.plugins, org.codehaus.mojo]
Killed
Any clue about where it can come from or how to correct it is welcome.
Thanks in advance

Related

GitLab gemnasium-maven analyzer v3.11.1 fails dependency scan due to unsupported class file major version 61

I'm attempting to setup GitLab dependency scanning for a repository in my self-hosted GitLab server. I have included the job template and the test stage since I have overridden the stage clause. The job starts, but it fails soon after. When I set the variable SECURE_LOG_LEVEL to debug I see the following output.
$ /analyzer run
Using java version 'adoptopenjdk-17.0.2+8'
[INFO] [gemnasium-maven] [2023-01-28T15:21:00Z] [/go/src/app/cmd/gemnasium-maven/main.go:55] ▶ GitLab gemnasium-maven analyzer v3.11.1
[DEBU] [gemnasium-maven] [2023-01-28T15:21:00Z] [/go/src/app/finder/finder.go:64] ▶ inspect directory: .
[DEBU] [gemnasium-maven] [2023-01-28T15:21:00Z] [/go/src/app/finder/finder.go:96] ▶ skip ignored directory: .git
[DEBU] [gemnasium-maven] [2023-01-28T15:21:00Z] [/go/src/app/finder/detect.go:84] ▶ Selecting gradle for maven because this is the first match
[INFO] [gemnasium-maven] [2023-01-28T15:21:00Z] [/go/src/app/finder/finder.go:116] ▶ Detected supported dependency files in '.'. Dependency files detected in this directory will be processed. Dependency files in other directories will be skipped.
[DEBU] [gemnasium-maven] [2023-01-28T15:21:00Z] [/go/src/app/cmd/gemnasium-maven/main.go:234] ▶ Exporting dependencies for /path/to/my/app/build.gradle
[DEBU] [gemnasium-maven] [2023-01-28T15:21:05Z] [/go/src/app/builder/gradle/gradle.go:85] ▶ /path/to/my/app/gradlew --init-script /gemnasium-gradle-plugin-init.gradle gemnasiumDumpDependencies
Downloading https://services.gradle.org/distributions/gradle-7.1.1-bin.zip
..........10%...........20%...........30%..........40%...........50%...........60%..........70%...........80%...........90%...........100%
Welcome to Gradle 7.1.1!
Here are the highlights of this release:
- Faster incremental Java compilation
- Easier source set configuration in the Kotlin DSL
For more details see https://docs.gradle.org/7.1.1/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* Where:
Initialization script '/gemnasium-gradle-plugin-init.gradle'
* What went wrong:
Could not compile initialization script '/gemnasium-gradle-plugin-init.gradle'.
> startup failed:
> General error during conversion: Unsupported class file major version 61
java.lang.IllegalArgumentException: Unsupported class file major version 61
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:189)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:170)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:156)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:277)
...
How can I resolve this issue? I am using GitLab server v15.7.5.
I found a StackOverflow thread that is very similar to the issue I'm having.
It appears the version of ASM bundled with GitLab gemnasium-maven analyzer v3.11 does not support class files version 61 in Java v17.0.2+8.
I was able to get this working by downgrading GitLab gemnasium-maven analyzer to v2.31.0 and have filed a support request with GitLab to notify them of the issue.
To downgrade the dependency scanner, add the following block of code to your CICD template
.ds-analyzer:
variables:
DS_MAJOR_VERSION: 2

Override Maven's download of a 3rd party software with a local copy?

I am running the 32-bit build of Ubuntu 18.04 and attempting to build a 32-bit Jenkins from the source.
It fails in the last stage (see below) because it cannot find a Linux x86 build of Nodejs. They don't make 32-bit versions for Linux anymore. I'm fine with that - I have downloaded the 14.15.4 Nodejs sources and built my own 32-bit version. How can I override the Jenkins maven build that is attempting to download a non-existent package directly from the Nodejs distribution site?
I have tried prepositioning my home-built node-14.15.4-linux-x86.tar.gz in the appropriate location, but the build is getting killed because the package does not exist on the website it is attempting to download from (404 - Not Found). If I could stop it trying to download or tell it to pull the .tar.gz package from the local filesystem, I think that should fix the problem. I haven't found anything online and maven configurations are completely foreign to me.
[INFO] Installing node version v14.15.4
[INFO] Downloading https://nodejs.org/dist/v14.15.4/node-v14.15.4-linux-x86.tar.gz to /home/scott/.m2/repository/com/github/eirslett/node/14.15.4/node-14.15.4-linux-x86.tar.gz
[INFO] No proxies configured
[INFO] No proxy was configured, downloading directly
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Jenkins main module 2.275-SNAPSHOT:
[INFO]
[INFO] Jenkins main module ................................ SUCCESS [ 4.868 s]
[INFO] Jenkins BOM ........................................ SUCCESS [ 0.156 s]
[INFO] Jenkins cli ........................................ SUCCESS [ 10.285 s]
[INFO] Jenkins core ....................................... SUCCESS [01:12 min]
[INFO] Jenkins war ........................................ FAILURE [ 4.536 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:35 min
[INFO] Finished at: 2021-01-08T00:47:30-06:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.11.0:install-node-and-yarn (install node and yarn) on project jenkins-war: Could not download Node.js: Got error code 404 from the server. -> [Help 1]

azure-webapp-maven-plugin config in Azure CLI doesn't execute

I am trying to follow the steps in https://spring.io/guides/gs/spring-boot-for-azure/. Under Config and deploy the app to Azure, when I run the "mvn com.microsoft.azure:azure-webapp-maven-plugin:1.8.0:config" command, the execution starts but doesn't complete. It stops where it is supposed to take user inputs but doesn't accept any values. Please find the execution logs below -
PS C:\Users\rthan\OneDrive\Documents\code\rest-service> mvn com.microsoft.azure:azure-webapp-maven-plugin:1.8.0:config
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< com.rainbowhomes:rest-service >--------------------
[INFO] Building rest-service 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- azure-webapp-maven-plugin:1.8.0:config (default-cli) # rest-service ---
[WARNING] The plugin may not work if you change the os of an existing webapp.
Define value for OS(Default: Linux):
1. linux [*]
2. windows
3. docker
Not sure what caused the issue, but if you want to deploy a Spring Boot app to Azure, you could refer to this doc, I successfully deployed the application via this doc last time, see this post.

Remote http archetypeCatalog doesn't work in Linux

I created one Maven archetype and uploaded to Nexus repository. I can generate one project based on that archetype with "mvn archetype:generate -DarchetypeCatalog=http://myhost:8080/nexus/content/repositories/my-snapshots/archetype-catalog.xml " command on Windows. The catalog xml is valid and I can open from browser manually.
Now I followed the same steps on Linux, configured the server part and repository profile in conf/setting.xml as the same content with Windows. The maven reported "No catalog defined. Using internal catalog". It seems the Maven didn't read the "-DarchetypeCatalog=...." part.
The debug log is as below. Maven version is 3.3.9. The issue reproduced on both Redhat and Ubuntu. Hope anyone can suggest a solution. Thanks.
[DEBUG] RuntimeInstance successfully initialized.
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-archetype-plugin:3.0.0:generate' with basic configurator -->
[DEBUG] (f) archetypeCatalog = http://myhost:8080/nexus/content/repositories/my-snapshots/archetype-catalog.xml
[DEBUG] (f) basedir = /opt/testmaven
[DEBUG] (f) interactiveMode = true
[DEBUG] (f) localRepository = id: local
url: file:///root/.m2/repository/
layout: default
snapshots: [enabled => true, update => always]
releases: [enabled => true, update => always]
[DEBUG] (f) remoteArtifactRepositories = [ id: my-snapshots
url: http://myhost:8080/nexus/content/repositories/my-snapshots
layout: default
snapshots: [enabled => true, update => always]
releases: [enabled => false, update => always]
, id: central
url: https://repo.maven.apache.org/maven2
layout: default
snapshots: [enabled => false, update => daily]
releases: [enabled => true, update => daily]
]
[DEBUG] (f) session = org.apache.maven.execution.MavenSession#4943defe
[DEBUG] -- end configuration --
[INFO] Generating project in Interactive mode
[INFO] No catalog defined. Using internal catalog
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: internal -> org.apache.maven.archetypes:maven-archetype-archetype (An archetype which contains a sample archetype.)
.......
In settings.xml, we need to configure a mirror :
<mirrors>
<mirror>
<name>Local Nexus Mirror</name>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://myhost:8080/nexus/content/groups/public</url>
</mirror>
</mirrors>
Once you’ve configured Nexus to be the mirror for all repositories, Maven will now consult the local installation of Nexus instead of going out to the central Maven repository.
If Nexus has the artifact requested, the artifact will be served from the local Nexus installation.
We can try specifying -DarchetypeCatalog=remote or -DarchetypeCatalog=local while generating the maven artifact through mvn archetype:generate.
If the archetype-cataog is available in local, we can directly use -Dcatalog=<url>

Chocolatey Installation of Visual Studio Pro 2012 is failing

I'm using Chocolatey to install Visual Studio 2012 Professional
> cinst visualstudio2012professional
In my Chocolatey logs, I'm seeing that the install succeeded.
[DEBUG] Running 'Delete-ExistingErrorLog' for VisualStudio2012Professional
[DEBUG] Looking for failure log at 'C:\Users\Chase\AppData\Local\Temp\chocolatey\VisualStudio2012Professional\failure.log'
[DEBUG] Found the failure log. Deleting it...
[DEBUG] Running 'Run-ChocolateyPS1' for VisualStudio2012Professional with packageFolder:'C:\chocolatey\lib\VisualStudio2012Professional.11.0.1', action: 'install'
[DEBUG] __ PowerShell install (chocolateyinstall.ps1) __
[DEBUG] Looking for chocolateyinstall.ps1 in folder 'C:\chocolatey\lib\VisualStudio2012Professional.11.0.1'. If chocolateyinstall.ps1 is found, it will be run.
[DEBUG] Action file is 'ChocolateyInstall.ps1'
[DEBUG] Running 'C:\chocolatey\lib\VisualStudio2012Professional.11.0.1\Tools\ChocolateyInstall.ps1'
[DEBUG] Running 'Install-ChocolateyPackage' for VisualStudio2012Professional with url:'http://go.microsoft.com/?linkid=9810233', args: '/Passive /NoRestart /AdminFile C:\chocolatey\lib\VisualStudio2012Professional.11.0.1\Tools\AdminDeployment.xml /Log C:\Users\Chase\AppData\Local\Temp\vs.log'
[DEBUG] Running 'Get-ChocolateyWebFile' for VisualStudio2012Professional with url:'http://go.microsoft.com/?linkid=9810233', fileFullPath:'C:\Users\Chase\AppData\Local\Temp\chocolatey\VisualStudio2012Professional\VisualStudio2012ProfessionalInstall.exe',and url64bit:'http://go.microsoft.com/?linkid=9810233'
[DEBUG] Processor width is 64.
Downloading VisualStudio2012Professional (http://go.microsoft.com/?linkid=9810233) to C:\Users\Chase\AppData\Local\Temp\chocolatey\VisualStudio2012Professional\VisualStudio2012ProfessionalInstall.exe
[DEBUG] Running 'Get-WebFile' for C:\Users\Chase\AppData\Local\Temp\chocolatey\VisualStudio2012Professional\VisualStudio2012ProfessionalInstall.exe with url:'http://go.microsoft.com/?linkid=9810233', userAgent: 'chocolatey command line'
[DEBUG] Setting the UserAgent to 'chocolatey command line'
[DEBUG] Running 'Install-ChocolateyInstallPackage' for VisualStudio2012Professional with file:'C:\Users\Chase\AppData\Local\Temp\chocolatey\VisualStudio2012Professional\VisualStudio2012ProfessionalInstall.exe', args: '/Passive /NoRestart /AdminFile C:\chocolatey\lib\VisualStudio2012Professional.11.0.1\Tools\AdminDeployment.xml /Log C:\Users\Chase\AppData\Local\Temp\vs.log'
Installing VisualStudio2012Professional...
[DEBUG] Running 'Start-ChocolateyProcessAsAdmin' with exeToRun:'C:\Users\Chase\AppData\Local\Temp\chocolatey\VisualStudio2012Professional\VisualStudio2012ProfessionalInstall.exe', statements: '/Passive /NoRestart /AdminFile C:\chocolatey\lib\VisualStudio2012Professional.11.0.1\Tools\AdminDeployment.xml /Log C:\Users\Chase\AppData\Local\Temp\vs.log '
Elevating Permissions and running C:\Users\Chase\AppData\Local\Temp\chocolatey\VisualStudio2012Professional\VisualStudio2012ProfessionalInstall.exe /Passive /NoRestart /AdminFile C:\chocolatey\lib\VisualStudio2012Professional.11.0.1\Tools\AdminDeployment.xml /Log C:\Users\Chase\AppData\Local\Temp\vs.log . This may take awhile, depending on the statements.
[DEBUG] Finishing 'Start-ChocolateyProcessAsAdmin'
VisualStudio2012Professional has been installed.
VisualStudio2012Professional has finished succesfully! The chocolatey gods have answered your request!
[DEBUG] Running 'Get-ChocolateyBins' for C:\chocolatey\lib\VisualStudio2012Professional.11.0.1
[DEBUG] __ Executable Links (*.exe) __
[DEBUG] Looking for executables in folder: C:\chocolatey\lib\VisualStudio2012Professional.11.0.1
Adding batch files for any executables found to a location on PATH. In other words the executable will be available from ANY command line/powershell prompt.
[DEBUG] There are no executables (that are not ignored) in the package.
[DEBUG] Evaluating NuGet output for line:
Finished installing 'visualstudio2012professional' and dependencies - if errors not shown in console, none detected. Check log for errors if unsure.
But unfortunately, Visual Studio isn't installed. The folders were created, but the IDE isn't there. (there is no DevEnv.exe)
Are there log files somewhere that are associated with the VS installer? Maybe an answer lies in there.
Hmm, I can't get the download that is used in that package to install, I am running a PS script so I am going to use this which seems to work:
$testFolder = Join-Path "${Env:ProgramFiles(x86)}" "Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe"
$alreadyInstalled = (Test-Path $testFolder)
if (!$alreadyInstalled)
{
Install-ChocolateyPackage 'VisualStudio2012Professional' 'exe' "/Full /Passive /NoRestart /Log $env:temp\vs.log" 'http://download.microsoft.com/download/D/E/8/DE8E42D8-7598-4F4E-93D4-BB011094E2F9/vs_professional.exe'
}

Resources