Skip to main content
edited body
Source Link

There is always the trick of involving system props so for instance you may have, like I do, a gui maven module with java and react/javscript/npm/-gui-code. If my pom.xml looks like

  <profile>
  <id>ui</id>
  <activation>
    <activeByDefault>true</activeByDefault>
    <!-- Only build the UI if the skipUI system prop is not set -->
    <property>
      <name>!skipUI</name>
    </property>
  </activation>
  <build>
    <plugins>
      <plugin>
      ..

then I can build it like

# mvn clean install

which will build the whole thing yet

# mvn -DskipUI clean install

will skip this part so I don't always have to wait two thousand years for the npm-stuff stuff for instance in my case - obviously not a solution 'just by profiles', the accepted answer describes this functionality. Yet if you can inject system props, this is what I usually do.

Also, maybe this is self explanatory but anyway, if you structure your project so you have a main parent pom on top of your child modules, then in this pom.xml you can say things like

  <modules>
    <module>apa</module>
    <module>bepa</module>
    <module>cepa</module>
    ..
  </modules>
  
  <profiles>
    <profile>
      <id>additions</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <modules>
        <module>epa</module>
        <module>fepa</module>
        ..
      </modules>
    </profile>
    ..

meaning that apa, bepa, cepa and the others in the 'main' modules section will always be built but if you provide the additions profile, then and only then epa and fepa will also be built.

There is always the trick of involving system props so for instance you may have, like I do, a gui maven module with java and react/javscript/npm/-gui-code. If my pom.xml looks like

  <profile>
  <id>ui</id>
  <activation>
    <activeByDefault>true</activeByDefault>
    <!-- Only build the UI if the skipUI system prop is not set -->
    <property>
      <name>!skipUI</name>
    </property>
  </activation>
  <build>
    <plugins>
      <plugin>
      ..

then I can build it like

# mvn clean install

which will build the whole thing yet

# mvn -DskipUI clean install

will skip this part so I don't always have to wait two thousand years for the npm-stuff for instance in my case - obviously not a solution 'just by profiles', the accepted answer describes this functionality. Yet if you can inject system props, this is what I usually do.

Also, maybe this is self explanatory but anyway, if you structure your project so you have a main parent pom on top of your child modules, then in this pom.xml you can say things like

  <modules>
    <module>apa</module>
    <module>bepa</module>
    <module>cepa</module>
    ..
  </modules>
  
  <profiles>
    <profile>
      <id>additions</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <modules>
        <module>epa</module>
        <module>fepa</module>
        ..
      </modules>
    </profile>
    ..

meaning that apa, bepa, cepa and the others in the 'main' modules section will always be built but if you provide the additions profile, then and only then epa and fepa will also be built.

There is always the trick of involving system props so for instance you may have, like I do, a gui maven module with java and react/javscript/npm/-gui-code. If my pom.xml looks like

  <profile>
  <id>ui</id>
  <activation>
    <activeByDefault>true</activeByDefault>
    <!-- Only build the UI if the skipUI system prop is not set -->
    <property>
      <name>!skipUI</name>
    </property>
  </activation>
  <build>
    <plugins>
      <plugin>
      ..

then I can build it like

# mvn clean install

which will build the whole thing yet

# mvn -DskipUI clean install

will skip this part so I don't always have to wait two thousand years for the npm stuff for instance in my case - obviously not a solution 'just by profiles', the accepted answer describes this functionality. Yet if you can inject system props, this is what I usually do.

Also, maybe this is self explanatory but anyway, if you structure your project so you have a main parent pom on top of your child modules, then in this pom.xml you can say things like

  <modules>
    <module>apa</module>
    <module>bepa</module>
    <module>cepa</module>
    ..
  </modules>
  
  <profiles>
    <profile>
      <id>additions</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <modules>
        <module>epa</module>
        <module>fepa</module>
        ..
      </modules>
    </profile>
    ..

meaning that apa, bepa, cepa and the others in the 'main' modules section will always be built but if you provide the additions profile, then and only then epa and fepa will also be built.

added 860 characters in body
Source Link

There is always the trick of involving system props so for instance you may have, like I do, a gui maven module with java and react/javscript/npm/-gui-code. If my pom.xml looks like

  <profile>
  <id>ui</id>
  <activation>
    <activeByDefault>true</activeByDefault>
    <!-- Only build the UI if the skipUI system prop is not set -->
    <property>
      <name>!skipUI</name>
    </property>
  </activation>
  <build>
    <plugins>
      <plugin>
      ..

then I can build it like

# mvn clean install

which will build the whole thing yet

# mvn -DskipUI clean install

will skip this part so I don't always have to wait two thousand years for the npm-stuff for instance in my case - obviously not a solution 'just by profiles', the accepted answer describes this functionality. Yet if you can inject system props, this is what I usually do.

Also, maybe this is self explanatory but anyway, if you structure your project so you have a main parent pom on top of your child modules, then in this pom.xml you can say things like

  <modules>
    <module>apa</module>
    <module>bepa</module>
    <module>cepa</module>
    ..
  </modules>
  
  <profiles>
    <profile>
      <id>additions</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <modules>
        <module>epa</module>
        <module>fepa</module>
        ..
      </modules>
    </profile>
    ..

meaning that apa, bepa, cepa and the others in the 'main' modules section will always be built but if you provide the additions profile, then and only then epa and fepa will also be built.

There is always the trick of involving system props so for instance you may have, like I do, a gui maven module with java and react/javscript/npm/-gui-code. If my pom.xml looks like

  <profile>
  <id>ui</id>
  <activation>
    <activeByDefault>true</activeByDefault>
    <!-- Only build the UI if the skipUI system prop is not set -->
    <property>
      <name>!skipUI</name>
    </property>
  </activation>
  <build>
    <plugins>
      <plugin>
      ..

then I can build it like

# mvn clean install

which will build the whole thing yet

# mvn -DskipUI clean install

will skip this part so I don't always have to wait two thousand years for the npm-stuff for instance in my case - obviously not a solution 'just by profiles', the accepted answer describes this functionality. Yet if you can inject system props, this is what I usually do.

There is always the trick of involving system props so for instance you may have, like I do, a gui maven module with java and react/javscript/npm/-gui-code. If my pom.xml looks like

  <profile>
  <id>ui</id>
  <activation>
    <activeByDefault>true</activeByDefault>
    <!-- Only build the UI if the skipUI system prop is not set -->
    <property>
      <name>!skipUI</name>
    </property>
  </activation>
  <build>
    <plugins>
      <plugin>
      ..

then I can build it like

# mvn clean install

which will build the whole thing yet

# mvn -DskipUI clean install

will skip this part so I don't always have to wait two thousand years for the npm-stuff for instance in my case - obviously not a solution 'just by profiles', the accepted answer describes this functionality. Yet if you can inject system props, this is what I usually do.

Also, maybe this is self explanatory but anyway, if you structure your project so you have a main parent pom on top of your child modules, then in this pom.xml you can say things like

  <modules>
    <module>apa</module>
    <module>bepa</module>
    <module>cepa</module>
    ..
  </modules>
  
  <profiles>
    <profile>
      <id>additions</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <modules>
        <module>epa</module>
        <module>fepa</module>
        ..
      </modules>
    </profile>
    ..

meaning that apa, bepa, cepa and the others in the 'main' modules section will always be built but if you provide the additions profile, then and only then epa and fepa will also be built.

Source Link

There is always the trick of involving system props so for instance you may have, like I do, a gui maven module with java and react/javscript/npm/-gui-code. If my pom.xml looks like

  <profile>
  <id>ui</id>
  <activation>
    <activeByDefault>true</activeByDefault>
    <!-- Only build the UI if the skipUI system prop is not set -->
    <property>
      <name>!skipUI</name>
    </property>
  </activation>
  <build>
    <plugins>
      <plugin>
      ..

then I can build it like

# mvn clean install

which will build the whole thing yet

# mvn -DskipUI clean install

will skip this part so I don't always have to wait two thousand years for the npm-stuff for instance in my case - obviously not a solution 'just by profiles', the accepted answer describes this functionality. Yet if you can inject system props, this is what I usually do.