How do you stop maven from trying to access http://repo.maven.apache.org?

All pom files inherit from the maven super POM http://maven.apache.org/ref/3.0.4/maven-model-builder/super-pom.html which contains this entry: <repositories> <repository> <id>central</id> <name>Central Repository</name> <url>http://repo.maven.apache.org/maven2</url> <layout>default</layout> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> Try setting this in your pom (with <id>central</id>): <repositories> <repository> <id>central</id> <url>http://repo.dev.bloomberg.com/content/groups/public</url> <releases> <enabled>false</enabled> </releases> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>central</id> <url>http://repo.dev.bloomberg.com/content/groups/public</url> <releases> <enabled>false</enabled> </releases> </pluginRepository> </pluginRepositories>

How to share a common build.gradle via a repository?

There are two possibilities: Publish a build script to a web server, and include it with apply from: “http://path/to/script.gradle” Write a Gradle plugin, publish it as a Jar to a Maven or Ivy repository, and include it with: buildscript { repositories { .. } dependencies “mygroup:myplugin:1.0” } apply plugin: “myplugin” The second option is more … Read more

Maven check for updated dependencies in repository

The Maven Versions plugin and it’s display-dependency-updates mojo are what you’re looking for: mvn versions:display-dependency-updates Here is what the output looks like: [INFO] ———————————————————————— [INFO] Building Build Helper Maven Plugin [INFO] task-segment: [versions:display-dependency-updates] [INFO] ———————————————————————— [INFO] [versions:display-dependency-updates] [INFO] [INFO] The following dependency updates are available: [INFO] org.apache.maven:maven-artifact …………………… 2.0 -> 2.0.9 [INFO] org.apache.maven:maven-plugin-api …………………. 2.0 … Read more

Multiple install:install-file in a single pom.xml

I would imagine something like this would work (this will install it on every build): <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-install-plugin</artifactId> <executions> <execution> <id>inst_1</id> <phase>initialize</phase> <goals> <goal>install-file</goal> </goals> <configuration> <!– config for file 1 –> </configuration> </execution> <execution> <id>inst_2</id> <phase>initialize</phase> <goals> <goal>install-file</goal> </goals> <configuration> <!– config for file 2 –> </configuration> </execution> <!– execution file 3… … Read more

How does maven sort version numbers?

Since version 3.0, Maven uses a consistent system to compare version numbers for both individual versions and version ranges. The system now makes a lot of sense, once you’ve understood a few gotchas. All comparisons are now done by ComparableVersion, which says: mixing of ‘-‘ (dash) and ‘.‘ (dot) separators, transition between characters and digits … Read more

How do I add a project as a dependency of another project?

Assuming the MyEjbProject is not another Maven Project you own or want to build with maven, you could use system dependencies to link to the existing jar file of the project like so <project> … <dependencies> <dependency> <groupId>yourgroup</groupId> <artifactId>myejbproject</artifactId> <version>2.0</version> <scope>system</scope> <systemPath>path/to/myejbproject.jar</systemPath> </dependency> </dependencies> … </project> That said it is usually the better (and preferred … Read more

Maven 3 warnings about build.plugins.plugin.version

Add a <version> element after the <plugin> <artifactId> in your pom.xml file. Find the following text: <plugin> <artifactId>maven-compiler-plugin</artifactId> Add the version tag to it: <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> The warning should be resolved. Regarding this: ‘build.plugins.plugin.version’ for org.apache.maven.plugins:maven-compiler-plugin is missing Many people have mentioned why the issue is happening, but fail to suggest a fix. All … Read more

How to override maven property in command line?

See Introduction to the POM finalName is created as: <build> <finalName>${project.artifactId}-${project.version}</finalName> </build> One of the solutions is to add own property: <properties> <finalName>${project.artifactId}-${project.version}</finalName> </properties> <build> <finalName>${finalName}</finalName> </build> And now try: mvn -DfinalName=build clean package

tech