2

We have product help document which is about 150Mb and being build every day and updated to maven repo.

So when we build the project which has dependency on help document it will download entire 150Mb once everyday and it takes lot of time.

Is there any way to avoid it? Like give an entry in pom.xml

<properties>
    <download.docmodule>true</download.docmodule>
</properties>

And in users settings.xml

<download.docmodule>false</download.docmodule>

And use this attribute to stop downloading the document?

Basically I want CI server to download it and package it but want developers not to waste time and bandwidth downloading it

<dependency>
    <groupId>docmodules</groupId>
    <artifactId>projname</artifactId>
    <version>${documentation.version}</version>
    <classifier>resources</classifier>
    <type>zip</type>
    <scope>provided</scope>
</dependency>
Dheeraj Joshi
  • 3,057
  • 8
  • 38
  • 55

1 Answers1

2

You can use profiles like:

    <profiles>
    <profile>
        <id>donloadHelp</id>
                    <dependencies>
                       <dependency>
                         //Add your dependency
                       </dependency>
                    </dependencies>
    </profile>
</profiles>

The help will only downloaded if you activate the profile in maven. To activate the profile, you have to call

 mvn <target> -PdownloadHelp
Jens
  • 67,715
  • 15
  • 98
  • 113
  • Is there anyway to activate profile using the pom properties? As per this link it is not possible http://stackoverflow.com/questions/3231797/specify-system-property-to-maven-project But i want to know if this can be achieved – Dheeraj Joshi Aug 05 '16 at 09:05
  • I do not think that is possible. But in my opinion it makes no sence. because you have to chnage the pom for that – Jens Aug 05 '16 at 09:12
  • I don't want to edit current bamboo server for adding this activation property file in its setting.xml. So if it was possible to edit the pom directly. If activation property is not defined in the pom then profile won't be activated at all. – Dheeraj Joshi Aug 05 '16 at 09:37
  • You can add it on the command line where you Trigger the maven build – Jens Aug 05 '16 at 09:40
  • Ended up using ! of property name !skip.doc.download – Dheeraj Joshi Aug 05 '16 at 10:54