Jenkins with Maven3 and multiple SVN-Modules. How to set differerent parent relativePaths?

StackOverflow https://stackoverflow.com/questions/13837434

  •  07-12-2021
  •  | 
  •  

Domanda

I'm struggling with our Jenkins configuration.

I've defined a jenkins-job with multiple SVN-Modules, because i want to checkout from different locations from the same svn-repository.

I need to define a optional module-directory for each checkout, because if i don't set one, Jenkins will checkout all my modules in the same directory and will always overwrite my .svn-directory (and consequent delete all files, i've checked out before).

So i set a optional directory for each checkout. And from this point, it's different to my folder-structure i use, when i checkout all my packages in my eclipse-workspace for exmaple. Because there is a flat-hierarchie.

So i can't use the same relativePath in my pom.xml to define the parent, when the relativePath is different between jenkins and development.

Example:

Jenkins (Tree-hierarchie): <relativePath>../<optionalModuleDir>/pom.xml</relativePath>

Eclipse-Workspace(Flat hierarchie): <relativePath>../pom.xml</relativePath>

I tried to use profiles, but i only can set modules in profiles, not the parent relativePath.

How can i use the same pom.xml with two different parent relativePath? Or what should i do instead to solve the problem?

È stato utile?

Soluzione

as a workaround modify your maven build as follows:

  • add a pre build step "Execute shell"/"Execute Windows batch command"
  • In this add a script which contains commands to move everything in place or to create symlinks to create the required structure.

when your build starts, after the checkout the sources will be brought into the required structure and then the build itself performs.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top