Where do CSS and JavaScript files go in a Maven web app project?

So if you have your DispatcherServlet configured in a REST like URL pattern such as / then css files would go under src/main/webapp/resources Just to clarify this is what I had to do: Make sure that in your servlet-context.xml you have as follows: <resources mapping=”/resources/**” location=”/resources/” /> Create a folder if does not already exist … Read more

Missing artifact com.sun.jdmk:jmxtools:jar:1.2.1

It’s not included anymore due to licensing issues if I remember correctly. If you don’t need jms functionality you can exclude jms from log4j dependency: <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.15</version> <exclusions> <exclusion> <groupId>com.sun.jmx</groupId> <artifactId>jmxri</artifactId> </exclusion> <exclusion> <groupId>com.sun.jdmk</groupId> <artifactId>jmxtools</artifactId> </exclusion> <exclusion> <groupId>javax.jms</groupId> <artifactId>jms</artifactId> </exclusion> </exclusions> </dependency>

Maven:Non-resolvable parent POM and ‘parent.relativePath’ points at wrong local POM

The normal layout for a maven multi module project is: parent ├── pom.xml ├── module    ├── pom.xml Check that you use this layout. Additionally: the relativePath looks strange. Instead of ‘..’ <relativePath>..</relativePath> try ‘../’ instead: <relativePath>../</relativePath> You can also remove relativePath if you use the standard layout. This is what I always do, and … Read more

Is it possible to pass a password in Maven Deploy in the command line?

The settings.xml is considered personal, so for that reason the username+password are stored in the (user-)settings.xml. So in general there’s no reason to pass them as argument. (btw, passwords can be stored encrypted here) The maven-deploy-plugin has no option to pass them via commandline. However, I’ve seen hacks like: <username>${internal.repo.username}</username> And now you can do … Read more

Gradle not including dependencies in published pom.xml

I was able to work around this by having the script add the dependencies to the pom directly using pom.withXml. //The publication doesn’t know about our dependencies, so we have to manually add them to the pom pom.withXml { def dependenciesNode = asNode().appendNode(‘dependencies’) //Iterate over the compile dependencies (we don’t want the test ones), adding … Read more

Plugins in Maven and POM.xml

<project> <groupId>org.koshik.javabrains</groupId> <artifactId>JarName</artifactId> (A fldernamed JarName was created) <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>JarName</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <build> <plugins> <plugin> <groupId>org.jibx</groupId> <artifactId>jibx-maven-plugin</artifactId> <version>1.2.4</version> <executions> <execution> <goals> <goal>bind</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> </project> You can also place plugins in the <build> section of <profile> if you use maven … Read more

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