Skip to content

Commit

Permalink
Maven: search for wrapper + use batch mode to remove colors
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel-Darbord committed Dec 17, 2024
1 parent b4c14ba commit c4cc3ae
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/MooseNexus/NexusMavenProject.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ NexusMavenProject >> analyze [
self parse: self read
]

{ #category : 'private' }
NexusMavenProject >> findMavenCommand [
"Return the name of the maven executable, can be a wrapper or the global 'mvn' command."

OSPlatform current isWindows
ifTrue: [
directory asFileReference / 'mvnw.cmd' ifExists: [ ^ 'mvnw.cmd' ] ]
ifFalse: [ "assume *nix"
directory asFileReference / 'mvnw' ifExists: [ ^ './mvnw' ] ].
"assume maven is installed"
^ 'mvn'
]

{ #category : 'initialization' }
NexusMavenProject >> initialize [
"Set the default home of all Maven projects."
Expand Down Expand Up @@ -115,7 +128,9 @@ NexusMavenProject >> read [
"Runs the `mvn` command using the `dependency:resolve` plugin.
Requires Maven to be installed."

^ LibC resultOfCommand: 'cd ' , directory , ' && mvn dependency:resolve'
^ LibC resultOfCommand:
'cd "' , directory , '" && ' , self findMavenCommand
, ' --batch-mode dependency:resolve'
]

{ #category : 'private' }
Expand Down

0 comments on commit c4cc3ae

Please sign in to comment.