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>
3
  • use maven profiles for that Commented Aug 5, 2016 at 5:38
  • Profiles? How exactly? Commented Aug 5, 2016 at 6:45
  • See my answer that will explain it Commented Aug 5, 2016 at 6:51

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

5 Comments

Is there anyway to activate profile using the pom properties? As per this link it is not possible stackoverflow.com/questions/3231797/… But i want to know if this can be achieved
I do not think that is possible. But in my opinion it makes no sence. because you have to chnage the pom for that
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.
You can add it on the command line where you Trigger the maven build
Ended up using ! of property name <activation> <property> <name>!skip.doc.download</name> </property> </activation>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.