Maven: How to include jars, which are not available in reps into a J2EE project?

For people wanting a quick solution to this problem: <dependency> <groupId>LIB_NAME</groupId> <artifactId>LIB_NAME</artifactId> <version>1.0.0</version> <scope>system</scope> <systemPath>${basedir}/WebContent/WEB-INF/lib/YOUR_LIB.jar</systemPath> </dependency> just give your library a unique groupID and artifact name and point to where it is in the file system. You are good to go. Of course this is a dirty quick fix that will ONLY work on your … Read more

Maven: missing net.sf.json-lib

Looking at the maven-central repo, you need to specify a classifier for this dependency. Either jdk13 or jdk15, like this: <dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.4</version> <classifier>jdk15</classifier> </dependency>

How to execute maven plugin execution directly from command line?

This functionality has been implemented as MNG-5768, and is available in Maven 3.3.1. The change will: extend direct plugin invocation syntax to allow optional @execution-id parameter, e.g., org.apache.maven.plugins:maven-remote-resources-plugin:1.0:process@executionId. So, in your case: mvn antrun:run uses the default-cli execution ID, and: mvn antrun:run@my-execution uses the execution configured in your pom.

Which maven dependencies to include for spring 3.0?

There was a really nice post on the Spring Blog from Keith Donald detailing howto Obtain Spring 3 Aritfacts with Maven, with comments detailing when you’d need each of the dependencies… <!– Shared version number properties –> <properties> <org.springframework.version>3.0.0.RELEASE</org.springframework.version> </properties> <!– Core utilities used by other modules. Define this if you use Spring Utility APIs … Read more

Is there a way to exclude a Maven dependency globally?

Does this help? http://jlorenzen.blogspot.com/2009/06/maven-global-excludes.html “Assuming I want to exclude avalon-framework from my WAR, I would add the following to my projects POM with a scope of provided. This works across all transitive dependencies and allows you to specify it once. <dependencies> <dependency> <artifactId>avalon-framework</artifactId> <groupId>avalon-framework</groupId> <version>4.1.3</version> <scope>provided</scope> </dependency> </dependencies> This even works when specifying it in … Read more

How to add an extra source directory for maven to compile and include in the build jar?

You can use the Build Helper Plugin, e.g: <project> … <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <version>3.2.0</version> <executions> <execution> <id>add-source</id> <phase>generate-sources</phase> <goals> <goal>add-source</goal> </goals> <configuration> <sources> <source>some directory</source> … </sources> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>

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