maven in 5 min not working

Found solution: Solution #1: issue was with proxy in settings.xml file: <host>webproxy</host> to get host goto IE->tools->connection->LAN settings->advanced->http. ===== Solution #2: if auto configured proxy is given: then 1> open IE(or any browser) 2> get the url address from your browser through IE->Tools->internet option->connections->LAN Settings-> get address and give in url eg: as and … Read more

Unzip dependency in maven

You can do it with dependencies:unpack-dependencies: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.2</version> <executions> <execution> <id>unpack-sigar</id> <phase>package<!– or any other valid maven phase –></phase> <goals> <goal>unpack-dependencies</goal> </goals> <configuration> <includeGroupIds>org.hyperic</includeGroupIds> <includeArtifactIds>sigar-dist</includeArtifactIds> <outputDirectory> ${}/wherever/you/want/it <!– or: ${project.basedir}/wherever/you/want/it –> </outputDirectory> </configuration> </execution> </executions> </plugin> Reference: Unpacking project dependencies dependency:unpack-dependencies

Maven plugin executing another plugin

Use the Maven Mojo executor by Don Brown of Atlassian fame to run any other arbitrary plugin. The Mojo Executor provides a way to to execute other Mojos (plugins) within a Maven 2 plugin, allowing you to easily create Maven 2 plugins that are composed of other plugins.

Maven – Add directory to classpath while executing tests

You can also add new test resource folders. <build> <testResources> <testResource> <directory>${project.basedir}/src/test/resources</directory> </testResource> <testResource> <directory>${project.basedir}/src/test/something_else</directory> </testResource> </testResources> </build> The first path, src/test/resources, is the default. Assuming you still want the default path to be used, make sure it’s included. (The testResources tag overwrites your defaults, so if you don’t include the default path explicitly, it … Read more

Maven: Including jar not found in public repository

You can install the project yourself. Or you can use the system scope like the following: <dependency> <groupId></groupId> <artifactId>Project</artifactId> <version>1.0.0</version> <scope>system</scope> <systemPath>${basedir}/lib/project-1.0.0.jar</systemPath> </dependency> systemPath requires the absolute path of the project. To make it easier, if the jar file is within the repository/project, you can use ${basedir} property, which is bound to the root of … Read more

Building same project in Maven with different artifactid (based on JDK used)

The Maven way to do this is not to change the finalName of the artifact but to use a classifier. For example: <project> … <build> <plugins> <plugin> <artifactId>maven-jar-plugin</artifactId> <configuration> <classifier>${envClassifier}</classifier> </configuration> </plugin> </plugins> </build> … <profiles> <profile> <id>jdk16</id> <activation> <jdk>1.6</jdk> </activation> <properties> <envClassifier>jdk16</envClassifier> </properties> </profile> <profile> <id>jdk15</id> <activation> <jdk>1.5</jdk> </activation> <properties> <envClassifier>jdk15</envClassifier> </properties> </profile> </profiles> … Read more