2

I need to build different type of library which differ only in manifest information.

It is not a good idea to make different projects since sources are exactly the same.

I tried module pom, but the child pom can not reference to the parent source.

I also tried artifactId with property(eg: libarayname-${type}), but it doesn't look right.

Anyone has an idea?

subodh
  • 6,136
  • 12
  • 51
  • 73
tompal18
  • 1,164
  • 2
  • 21
  • 39

3 Answers3

1

You should try using the assembly plugin

Use two different assembly descriptors, and you will also be able to specify different MANIFEST files. See the plugin usage for more info.

You two libraries can then be generated with different classifiers, so that other project can depend on any.

Tome
  • 3,234
  • 3
  • 33
  • 36
0

You can customize the MANIFEST.MF by configuring the maven archiver plugin

A "brute force" approach to what you're trying to achieve is to create a maven profile for each variation of MANIFEST.MF that you need.

NilsH
  • 13,705
  • 4
  • 41
  • 59
  • The problem is that artifactID is the same. When I run deploy, the jars will upload to the same artifactID in repository. – tompal18 Mar 26 '13 at 09:20
  • True. I didn't think of that. In that case, the suggestion to use multiple pom-files sounds like a good idea. – NilsH Mar 26 '13 at 09:25
0

What you should actually use is a classifier. Check the maven-jar-plugin for more info on how to produce more than one artifacts from a single project. For example, if the project is called foo, then you can have foo-1.2.3 and foo-1.2.3-jdk14, or something along those lines.

carlspring
  • 31,231
  • 29
  • 115
  • 197