maven-2

Override Maven's default resource filter replacement pattern

旧街凉风 提交于 2019-12-03 10:18:47
By default maven will filter resources like this: <properties> <replace.me>value</replace.me> </properties> <some-tag> <key>${replace.me}</key> </some-tag> will get you: <some-tag> <key>value</key> </some-tag> Is there a way to override the way maven selects the strings to replace? Specifically, I want to be able to use this: <some-tag> <key>@replace.me@</key> </some-tag> to get the same result as above. Have a look at the delimiters parameter of the resources mojo. Configuring the plugin like this will do the trick: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven

What is the difference between artifactId and groupId in pom.xml?

一个人想着一个人 提交于 2019-12-03 10:14:09
How would you explain it to a newbie web developer or programmer with some real world organization example (like say facebook company or Google company)? From maven.apache.org, Naming Conventions : artifactId is the name of the jar without version. If you created it then you can choose whatever name you want with lowercase letters and no strange symbols. If it's a third party jar you have to take the name of the jar as it's distributed. eg. maven , commons-math groupId will identify your project uniquely across all projects, so we need to enforce a naming schema. It has to follow the package

Why is javac 1.5 running so slowly compared with the Eclipse compiler?

前提是你 提交于 2019-12-03 09:45:20
问题 I have a Java Maven project with about 800 source files (some generated by javacc/JTB) which is taking a good 25 minutes to compile with javac. When I changed my pom.xml over to use the Eclipse compiler, it takes about 30 seconds to compile. Any suggestions as to why javac (1.5) is running so slowly? (I don't want to switch over to the Eclipse compiler permanently, as the plugin for Maven seems more than a little buggy.) I have a test case which easily reproduces the problem. The following

Using Maven for Coldfusion project

拈花ヽ惹草 提交于 2019-12-03 09:42:56
问题 I have to deal with what is pretty ugly and large blob of ColdFusion code which up to this day is maintained by direct modifications on production server (don't ask). I managed to clean it up from dupes and backups and put it into Subversion, now I need tp pick a make system to be able to put this onto continuous build (TeamCity) and also scheduled releases. To my surprise I only found pretty much a single blog article on how to retrofit CF project with Maven, so the question is - does anyone

In Maven2, what's the simplest way to build a WAR and the EAR to contain that WAR in a single POM?

半世苍凉 提交于 2019-12-03 09:41:33
问题 Situation is pretty straightforward. I have a Java webapp that I'm converting to be built with Maven. At present, the app is built with Ant into a single WAR file, which is then bundled into an EAR with a very simple application.xml. maven-war-plugin and maven-ear-plugin both look pretty straightforward to me, and it appears they're setting me up to be forced to consider the above as two distinct projects, with the WAR project as a dependency of the EAR project. This seems a tad inconvenient,

How to make maven use system proxy settings

萝らか妹 提交于 2019-12-03 09:30:58
I'm using Ubuntu with Gnome where I can set network proxy settings (with authentication). The question is: how I can run maven in command line and make it use this proxy? Pascal Thivent There is a java.net.useSystemProxies system property that can be set to true (on Windows and Linux platforms) to tell the JVM to use the system proxy settings. From the Java Networking and Proxies guide: Before we see in details how to write such a ProxySelector , let's talk about the default one. J2SE 5.0 provides a default implementation which enforces backward compatibility. In other terms, the default

Maven2 & Swing projects: Build & run swing application

只谈情不闲聊 提交于 2019-12-03 09:28:42
问题 I tried to find info on how to use maven to build and run a swing application but couldn't find anything useful (maven documentation is a mess). Can someone point me to relevant documentation? Is anyone using maven in swing development ? 回答1: I'm guessing that you want to run your app from a maven command. You can use the exec plugin like this: <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.1-beta-1</version> <executions>

Facing NoSuchMethodError for io.netty.util.AttributeKey.valueOf() method with grpc and protobuf Hello world example

青春壹個敷衍的年華 提交于 2019-12-03 09:23:39
After running GreetingServerTest.java tests I am getting below given errors. I am using grpc 1.1.0-SNAPSHOT libraries and trying to implement basic Helloword example of grpc given in there git repo. Can anybody please suggest which libraries I am missing or there's anything else I need to do. java.lang.NoSuchMethodError: io.netty.util.AttributeKey.valueOf(Ljava/lang/Class;Ljava/lang/String;)Lio/netty/util/AttributeKey; at io.grpc.netty.Utils.<clinit>(Utils.java:87) at io.grpc.netty.NettyServer.allocateSharedGroups(NettyServer.java:187) at io.grpc.netty.NettyServer.start(NettyServer.java:116)

How to get the current MavenSession or MavenExecutionRequest from a Plexus Component

拈花ヽ惹草 提交于 2019-12-03 09:17:18
I created a Plexus component to house common logic for several Mojos I want to create. I have been able to pass information like localRepository and project from the Mojo (and test cases). I was wondering if there is a way to get the MavenSession or MavenExecutionRequest from within the component without having to pass them as parameters from a Mojo. I know my component will be running from a Maven Mojo. I'm using Maven 2 in this instance. I don't believe there is, nor would I think it's a good idea. From my understanding, what you're aiming to achieve is have a commons-like component, that

Organize imports with Maven2, Eclipse-style?

 ̄綄美尐妖づ 提交于 2019-12-03 09:02:59
I'm a lone Emacs user in a group that's hung up on Eclipse. Time and again, code diffs are made larger by imports that have been "organized" or "cleaned up" by Eclipse. I don't have a strong opinion on the subject of import style in Java, but I do want to minimize our diffs. What can I do? We use Maven2 for builds; is there a plugin that can help me? Can a piece of Eclipse be abstracted out & turned into a Maven plugin? I currently use ImportScrubber and have encountered a few other stand-alone pieces that do the same thing. What I'm really looking for is a Maven plugin that can integrate with