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 http://autocache.abc.com/ and … Read more

With Maven, how can I build a distributable that has my project’s jar and all of the dependent jars?

For a single module, I’d use an assembly looking like the following one (src/assembly/bin.xml): <assembly> <id>bin</id> <formats> <format>tar.gz</format> <format>tar.bz2</format> <format>zip</format> </formats> <dependencySets> <dependencySet> <unpack>false</unpack> <scope>runtime</scope> <outputDirectory>lib</outputDirectory> </dependencySet> </dependencySets> <fileSets> <fileSet> <directory>src/main/command</directory> <outputDirectory>bin</outputDirectory> <includes> <include>*.sh</include> <include>*.bat</include> </includes> </fileSet> </fileSets> </assembly> To use this assembly, add the following configuration to your pom.xml: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptors> … Read more

Maven: Customize web.xml of web-app project

is there a way to have two web.xml files and select the appropriate one depending on the profile? Yes, within each profile you can add a configuration of the maven-war-plugin and configure each to point at a different web.xml. <profiles> <profile> <id>profile1</id> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <webXml>/path/to/webXml1</webXml> </configuration> </plugin> … As an alternative … 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> ${project.build.directory}/wherever/you/want/it <!– or: ${project.basedir}/wherever/you/want/it –> </outputDirectory> </configuration> </execution> </executions> </plugin> Reference: Unpacking project dependencies dependency:unpack-dependencies

Best way to debug Java web application packaged as a WAR using Eclipse and Maven?

If you run your WAR with tomcat/jetty plugin pass debug options to the Maven: export MAVEN_OPTS=”-Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000″ mvn tomcat:run If you run your WAR using the regular Tomcat, just run it with JPDA (debugger) support enabled: $TOMCAT_HOME/bin/catalina.sh jpda start Default port for Tomcat 6 JPDA is 8000. Now connect with the Eclipse (Debug -> Remote … Read more