Dynamic artifact paths

Answered
 

I have a multi-module maven project that is built by teamcity. This is working and the resulting artifacts are:

/plugins/plugin-a/target/plugin-a-1.2.3.jar
/plugins/plugin-b/target/plugin-b-1.2.3.jar
/plugins/...

Currently, the artifacts are collected using this under general settings:

plugins/**/target/*.jar => dist/plugins

So, I have all needed files in the dist-folder (afterwards they are pushed to a deployment-server via ssh). However, due to the fact that (according to the docs) directories as created after the first wildcard, teamcity keeps the "target"-folder:


/dist/plugins/plugin-a/target/plugin-a-1.2.3.jar
/dist/plugins/plugin-b/target/plugin-b-1.2.3.jar

What I need is to remove the target directory from the results:

/dist/plugins/plugin-a/plugin-a-1.2.3.jar
/dist/plugins/plugin-b/plugin-b-1.2.3.jar

There are a lot of plugins and they change from time to time, so I don't want define them all with static paths. Therefore, using plugins/plugin-a/target/*.jar => dist/plugins/plugin-a is possible, but not feasible.

So, how can I remove the target directory from the artifact path, without selecting other jars that are not within the target directory?

TeamCity Version is 10.0.4

0
1 comment
Avatar
Permanently deleted user

Hello Den,

Yes, TeamCity will create directories starting from the first occurrence of the wildcard in the pattern.

To workaround this you can write a simple command line step or script to find all your plugins' jar files, copy them into some directory and use it as artifact source.

0

Please sign in to leave a comment.