I`m trying to build a maven project in Hudson and here I set the path for the .properties files. Yet it seems to get them from somewhere else (it definitely gets them because it connects to the db and runs some queries) because I set this to a invalid path on purpose.
There is no error and everything runs OK.
I need to add another variable to the .properties file and it seems to ignore it. Is there a temp/cache folder it uses?
Goals and options: clean process-resources "-Dproperties=/data/ic/test/aradd" -Denv=test site clean
If your application uses a business and a batch component verify the properties for the business component. Be careful for the declared folder for your business component properties.
Related
I am close to publishing by first open-source library to the Sonatype repository. Everything works fine locally, but I want to automate the process so that whenever I create a new tag/version, the version get's published directly from Gitlab CI
Now, I have two problems: the secring.gpg file and the passwords.
I know that I can have protected variables for my CI, but I don't know two things:
How to use them during my build process (I am using gradle):
I need the signing.password, the signing.secretKeyRingFile path and the ossrhPassword, all of which are located in the gradle.properties file
How to store the sigring.gpg file, which is a binary file and I can't copy-paste it in the variable.
I'd like to include a robots.txt file into a WAR file but use a different version based on the destination (e.g. sandbox or production).
What is the best way to achieve this with maven? My first thought it is
Create two different robots.txt in the source code; one called produdction.robots.txt and another called sandbox.robots.txt
Use https://coderplus.github.io/copy-rename-maven-plugin/rename-mojo.html to rename the appropriate file to robots.txt during the build process
use maven war configuration to exclude the other file
Is there a more elegant way? Note: we're using Gitlab CI/CD though I don't think that is too pertinent, assuming it is best to keep this process solely within the maven build cycle.
Thanks!
I want to create automatic upload to ftp, using 'FTP Upload' runner, with different build configuration, which depends on successfull build of main configuration. But the thing is I don't know the pattern. As for now path looks like this:
C:\ProgramData\JetBrains\TeamCity\system\artifacts\<project_name>\<build config name>\528
What variable contains this last number?
The problem was with bad description of my problem, more definiteve one:
I have to store artifacts on FTP. FTP is on the same machine as TC server and agent (don't ask me why). So I have to somehow grab artifacts and put them into ftp://"project"/msi and ftp://"project"/nuget, depending on build configuration. I've tried: Grabbing artifacts directly - from folder shown in the initial post, idea failed.
The solution is to create another build configuration and set Artifact dependencies, this makes artifacts reachable from new build configuration, which allows to use FTP Upload runner.
Thanks everyone!
I need to show version number including three figures
1. Using pom version (done)
2. Commit number from Git (done)
3. Build number from Bamboo ( worst part :( )
I tried to make one property file with placeholders as bamboo.properties in my project. I am expecting that when Bamboo prepares the build it will replace those properties and include that file in war. Later I will read those properties and expose to Web Layer.
Am I doing right? Because I need that my other team members should able to make build locally without Bamboo?
bamboo.properties:
bamboo.buildKey=${bamboo.buildKey}
bamboo.buildResultsUrl=${bamboo.buildResultsUrl}
bamboo.buildNumber=${bamboo.buildNumber}
bamboo.buildPlanName=${bamboo.buildPlanName}
bamboo.buildTimeStamp=${bamboo.buildTimeStamp}
Here is how we achieve above after long time.
Pom version
A simple maven property that can be accessed.
Commit id from git
Since in this project we are using git only, there is a maven plugin that gives you information about commit number. With the help of it you can retrieve Git commit id. For details please look for
git-commit-id-plugin
For bamboo there is environment variable that you need to configure in bamboo settings (For me this has done by client as he owns it). But after it we access it in our env as "<bamboo.build.no>"
Thanks
I've been tasked with writing scripts to interact with Nexus/Maven. The files I'm working with in Maven are XML files placed there with the specific idea that they would be used by shell scripts. Essentially, the files are configurations for another application.
I've already completed the scripts to pull the files from the repositories, but I'm having problems with putting files into the repositories. To pull the files, I'm using the plugin dependency:get.
What I need is more or less the opposite of that plugin. One that will update the repository with new versions of a file. I think that "mvn deploy:deploy-file" is what I need to use. Will that work?
If so, then the next problem I have is that I can't seem to figure out how to set up the authorization. I have a settings file with a server defined that has the correct authorization information in it, but the link between the server and the repository (or URL?) is missing and the authorization isn't being performed correctly.
How do I connect the repository URL to the server info in the settings.xml file so that mvn will be authorized to perform the correct actions? (I don't know where the .pom file is for Maven, and may not have permissions to alter it.)
Thanks,
Sean.
deploy:deploy-file is correct. Use it with -Durl=http://repo:port/path, -DrepositoryId=server-whatever. Your settings.xml needs to contain
<servers>
<server>
<id>server-whatever</id>
<username>demo</username>
<password>demo</password>
</server>
</servers>
where the server ID server-whatever matches the repositoryId parameter.
Having said that, I'd question the appropriateness of Maven for this. It's designed for binary artifaccts rather than configuration.
The problem turned out to be in the -Durl option.
When using the dependency:get plugin, the URL was something like:
-Durl=http://companymavenrepo
And that worked fine for the dependency plugin.
However, that's not sufficient when trying to put things into the repository using the deploy plugin. The URL has to contain the maven server and the exact repository of where to place the artifact. (My terminology might be off.) I went to our Nexus/Sonatype webpage, looked at the exact repository where the artifact was stored, then used something like this:
-Durl=http://companymavenrepo/nexus/content/repositories/this_maven_repo
That solved the authorization problem, and I was able to add the file into the repository without issue.
(This might have been easier for other to see had I posted both mvn command lines I was trying to use. On the other hand, it also seems reasonable that when you use the -Durl option with a specific value in one command line and it works that it will work unchanged in another command line.)
Sean.