Difference of Maven JAXB plugins

Let’s summarize. We have/had: the maven-jaxb2-plugin (https://github.com/highsource/maven-jaxb2-plugin) the maven-jaxb-plugin (https://jaxb.dev.java.net/jaxb-maven2-plugin/) the jaxb2-maven-plugin (https://github.com/mojohaus/jaxb2-maven-plugin) Based on the comments of this thread, I’ve always used the maven-jaxb2-plugin (i.e. plugin #1): Concerning the org.jvnet.jaxb2.maven2:maven-jaxb2-plugin versus com.sun.tools.xjc.maven2:maven-jaxb-plugin, from my point of view it’s definitely the first one (http://maven-jaxb2-plugin.java.net/). This plugin has much more features than com.sun.tools.xjc.maven2:maven-jaxb-plugin, the development is … Read more

Add a dependency in Maven

You’ll have to do this in two steps: 1. Give your JAR a groupId, artifactId and version and add it to your repository. If you don’t have an internal repository, and you’re just trying to add your JAR to your local repository, you can install it as follows, using any arbitrary groupId/artifactIds: mvn install:install-file -DgroupId=com.stackoverflow… … Read more

How to keep Maven profiles which are activeByDefault active even if another profile gets activated?

One trick is to avoid activeByDefault, and instead activate the profile by the absence of a property, eg: <profiles> <profile> <id>firstProfile</id> <activation> <property> <name>!skipFirstProfile</name> </property> </activation> … </profile> </profiles> You should then be able to deactivate the profile with -DskipFirstProfile or with -P !firstProfile, but otherwise the profile will be active. See: Maven: The Complete … Read more

How do I execute a program using Maven?

With the global configuration that you have defined for the exec-maven-plugin: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.4.0</version> <configuration> <mainClass>org.dhappy.test.NeoTraverse</mainClass> </configuration> </plugin> invoking mvn exec:java on the command line will invoke the plugin which is configured to execute the class org.dhappy.test.NeoTraverse. So, to trigger the plugin from the command line, just run: mvn exec:java Now, if you want … Read more

How can I create an executable/runnable JAR with dependencies using Maven?

<build> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>fully.qualified.MainClass</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> </plugins> </build> and you run it with mvn clean compile assembly:single Compile goal should be added before assembly:single or otherwise the code on your own project is not included. See more details in comments. Commonly this goal is tied to … Read more

How do I install Maven with Yum?

Icarus answered a very similar question for me. Its not using “yum”, but should still work for your purposes. Try, wget http://mirror.olnevhost.net/pub/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz basically just go to the maven site. Find the version of maven you want. The file type and use the mirror for the wget statement above. Afterwards the process is easy Run the … Read more

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