Maven: Quick tips

Feb 10, 2023

devtip , maven

Allow HTTP based maven repositories (by default they are blocked in Maven 3.8.x and above)



  ...
  ...

  
  
    
      maven-default-http-blocker
      dummy
      Pseudo repository to mirror external repositories initially using HTTP.
      http://0.0.0.0/
      false
    
  

Disable expansion of ! (exclamation mark) while excluding modules in a maven build

# Option 1 - Disable Shell History
set +H

# Option 2 - Use single quotes around `!` to prevent expansion OR `\` to escape it
# Below is an exmaple usecase for maven based build use case
mvn install -Phive -Pyarn -Phive-thriftserver -pl '!':spark-yarn_2.12,'!':spark-hive-thriftserver_2.12,'!':spark-core_2.12,'!':spark-sql_2.12,'!':spark-mllib_2.12,'!':spark-hive_2.12,'!':spark-streaming-kafka-0-10_2.12

mvn install -Phive -Pyarn -Phive-thriftserver -pl \!:spark-yarn_2.12,\!:spark-hive-thriftserver_2.12,\!:spark-core_2.12,\!:spark-sql_2.12,\!:spark-mllib_2.12,\!:spark-hive_2.12,\!:spark-streaming-kafka-0-10_2.12

Links Awards & recognitions Resume Personal Technical Miscellaneous My Blog
 
Last Updated: Feb 10 2023