How can I update a property in a Maven POM?

Is there a simple way to rewrite a Maven property entry to a specific value Since version 2.5 we can use set-property (documentation): mvn versions:set-property -Dproperty=your.property -DnewVersion=arbitrary_value As documented, the set-property goal does not perform any ‘sanity checks’ on the value you specify, so it should always work, but you should use with care.

How to use POMs as a dependency in Maven?

You have to go with <dependencies> <dependency> <groupId>com.my</groupId> <artifactId>commons-deps</artifactId> <type>pom</type> </dependency> </dependencies> This will transitively add all dependencies declared in com.my:commons-deps to your current POM. Using <dependencyManagement> <dependencies> <dependency> <groupId>…</groupId> <artifactId>…</artifactId> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> works as a simple ‘include’ of artifacts versions in your dependency management. Thus, it won’t add any dependency in … Read more

maven generating pom file

This is an old question, but was a serious PITA for me for a few minutes, so I thought I’d share: I just ran into this problem, and I believe that the issue is probably platform-dependent. The real tip-off was that the solution from Cyril’s answer wasn’t working as expected: despite my specification of -DgroupId=com.xyz … Read more

Manually adding aar with dependency pom/iml file

1. Publishing In your aar project, add maven-publish plugin and add necessary plugin configuration. apply plugin: ‘com.android.library’ apply plugin: ‘maven-publish’ … dependencies { testCompile ‘junit:junit:4.12’ compile ‘com.android.support:appcompat-v7:23.1.1’ compile ‘com.novoda:bintray-release:0.2.7’ } … publishing { publications { maven(MavenPublication) { groupId ‘com.example’ //You can either define these here or get them from project conf elsewhere artifactId ‘example’ version … Read more

Maven error Cannot access defaults field of Properties

Change the version of the war plugin in your pom.xml and add maven-compiler-plugin according to your jdk version. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.3.1</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> </plugin>

Missing artifact com.oracle:ojdbc6:jar:11.2.0 in pom.xml

Due to Oracle license restriction, there are no public repositories that provide ojdbc jar. You need to download it and install in your local repository. Get jar from Oracle and install it in your local maven repository using mvn install:install-file -Dfile={path/to/your/ojdbc.jar} -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar If you are using ojdbc7, here is the link

Getting maven project version and artifact ID from pom while running in Eclipse

Create a property file src/main/resources/project.properties with the below content version=${project.version} artifactId=${project.artifactId} Now turn on maven resource filtering <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> so that this file is processed into target/classes/project.properties with some content similar to this version=1.5 artifactId=my-artifact Now you can read this property file to get what you want and this should work every time. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)