Skip to content

Commit

Permalink
Fix writing settings file
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Jun 27, 2024
1 parent e0867ae commit 1677a91
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 30 deletions.
24 changes: 12 additions & 12 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

35 changes: 18 additions & 17 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ async function main() {

core.debug(`Found pom files: ${pomFiles}`)

const mavenSettings = path.join(tempDir, 'maven-settings.xml')
fs.writeFileSync(
mavenSettings,
`
<settings>
<servers>
<server>
<id>remote-repository</id>
<username>\${env.REMOTE_REPO_USERNAME}</username>
<password>\${env.REMOTE_REPO_PASSWORD}</password>
</server>
</servers>
</settings>
`,
{ encoding: 'utf8' }
)

for (let pomFile of pomFiles) {
// We need to know the basename to find all the other file-types to deploy
const pomPath = path.parse(pomFile)
Expand All @@ -40,25 +57,9 @@ async function main() {
continue
}

const mavenSettings = path.join(tempDir, 'maven-settings.xml')
fs.writeFileSync(
mavenSettings,
`
<settings>
<servers>
<server>
<id>remote-repository</id>
<username>\${env.REMOTE_REPO_USERNAME}</username>
<password>\${env.REMOTE_REPO_PASSWORD}</password>
</server>
</servers>
</settings>
`,
{ encoding: 'utf8' }
)

// Build the maven commandline
let cmd = [
"--batch",
'-s',
mavenSettings,
'org.apache.maven.plugins:maven-deploy-plugin:deploy-file',
Expand Down

0 comments on commit 1677a91

Please sign in to comment.