Maven: How to change path to target directory from command line?

You should use profiles. <profiles> <profile> <id>otherOutputDir</id> <build> <directory>yourDirectory</directory> </build> </profile> </profiles> And start maven with your profile mvn compile -PotherOutputDir If you really want to define your directory from the command line you could do something like this (NOT recommended at all) : <properties> <buildDirectory>${project.basedir}/target</buildDirectory> </properties> <build> <directory>${buildDirectory}</directory> </build> And compile like this : … Read more

Setting Java heap space under Maven 2 on Windows

The environment variable to set is MAVEN_OPTS, for example MAVEN_OPTS=-Xmx1024m. The maxmem configuration in the pom only applies when you set the compiler plugin to fork javac into a new JVM. Otherwise the plugin runs inside the same VM as Maven and thus within the memory passed on the command line via the MAVEN_OPTS. To … Read more

How can I tell jaxb / Maven to generate multiple schema packages?

I had to specify different generateDirectory (without this, the plugin was considering that files were up to date and wasn’t generating anything during the second execution). And I recommend to follow the target/generated-sources/<tool> convention for generated sources so that they will be imported in your favorite IDE automatically. I also recommend to declare several execution … Read more

java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet

You need to add the “Maven Dependency” in the Deployment Assembly right click on your project and choose properties. click on Deployment Assembly. click add click on “Java Build Path Entries” select Maven Dependencies” click Finish. Rebuild and deploy again Note: This is also applicable for non maven project.

Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor

Perhaps a version of maven war plugin is being used, which does not work with Java 7? As per this issue (which describes a similar problem), 2.1.1 version of maven war plugin should work. Include the following in your pom.xml <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> </plugin>

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