maven-2

Are these two settings same in maven?

£可爱£侵袭症+ 提交于 2019-12-04 07:32:35
I want to limit maven to use only private/not public maven repository, do these two settings have the same effect ? 1.Setting mirror in settings.xml <mirrors> <mirror> <id>my-internal-site</id> <mirrorOf>*</mirrorOf> <name>our maven repository</name> <url>http://myserver/repository</url> </mirror> </mirrors> 2.Setting repository in pom.xml <repositories> <repository> <id>my-internal-site</id> <name>our maven repository</name> <url>http://myserver/repo</url> </repository> </repositories> Again the requirement is that maven never goes out to public repositories even if some dependencies are not

Integrate Protocol Buffers into Maven2 build

≡放荡痞女 提交于 2019-12-04 07:30:40
问题 I'm experimenting with Protocol Buffers in an existing, fairly vanilla Maven 2 project. Currently, I invoke a shell script every time I need to update my generated sources. This is obviously a hassle, as I would like the sources to be generated automatically before each build. Hopefully without resorting to shameful hackery. So, my question is two-fold: Long shot: is there a "Protocol Buffers plugin" for Maven 2 that can achieve the above in an automagic way? There's a branch on Google Code

How to access a XML file in a maven project so it stays available when packaged

假装没事ソ 提交于 2019-12-04 07:03:01
I currently started working on a maven web-app project that needs to be launched with the jetty:run-exploded goal for development/debugging in eclipse. Now, I have an XML file which contents I need to access at runtime. My problem is: where to put the file so that the code that does the reading works both in "exploded" and packaged (i.e. in the WAR) mode? Putting the file in src/main/java (so as to be in the classpath) won't cut it since maven filters out all non-java files on packaging. When the file is in src/main/resources, one mean would be to figure out the root path of the project

Maven Release Plugin with Svn:Externals and a multi-module project

独自空忆成欢 提交于 2019-12-04 06:40:41
Given the following sample multi-module project: aggr/pom.xml (Version 1.0-SNAPSHOT) aggr/parent/pom.xml (Version 2.0-SNAPSHOT) aggr/app/pom.xml (Version 3.0-SNAPSHOT) aggr/comp1/pom.xml (Version 4.0-SNAPSHOT) where parent is the parent of any other pom and app has a dependency of comp1. Releasing via release:prepare/perform just works fine as long as the aggr folder has the same structure within the svn repository (repository/trunk/aggr/parent.pom, ...). Now when I want to use the same project but with svn:externals, the release-plugin doesn't work stating that comp1: Can't release project

Maven Tomcat Embedded

只愿长相守 提交于 2019-12-04 06:26:28
I am trying to run a Spring webapp using maven with the mvn tomcat:run command, but whenever I navigate to http://localhost:8080/myApp , I get the error: "The requested resource () is not available". Nothing shows up in the logs. I think my app is supposed to be deployed to "/" instead of "/myApp". Is there a way to do this? Maven output log: [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'tomcat'. [INFO] ------------------------------------------------------------------------ [INFO] Building myApp [INFO] task-segment: [tomcat:run] [INFO] ------------------

Run Netbeans maven project from command-line?

拥有回忆 提交于 2019-12-04 06:22:00
I've got a Maven project that runs perfectly inside Netbeans. How can I execute the application from the command-line (without Netbeans)? There's a plugin for that: http://www.mojohaus.org/exec-maven-plugin/ $ mvn exec:java -Dexec.mainClass="com.mycompany.App" Assuming com.mycompany.App is you main class. Using the Maven Exec Plugin and its exec:java goal as suggested is a first option. And the command suggested is correct, you have to specify -Dexec.mainClass=VALUE on the command line. mvn exec:java -Dexec.mainClass=com.acme.Hello Regarding your "classpath problem", well, you didn't describe

Creating an archive of all jars and source jars for a multi-module project

Deadly 提交于 2019-12-04 06:04:50
I'm building a Maven project which has half a dozen modules. I'm fine with importing it myself using either Maven or Ivy, but other teams would like to use those jars as well, but their practice is to commit the jars and source jars to version control. I'd like to generate a zip/tar assembly of all modules and their sources which they can use however they like. I've read Maven Assembly Plugin: Including Module Binaries but I'm shy of using it because: The linked FAQ entry returns a 404; I need to manually specify all modules. Is there an alternative? Update : I've tried using the built-in

maven dependencies groovy

谁说我不能喝 提交于 2019-12-04 05:54:12
I'm running a project that has a dependency on groovy 1.7-beta-1. The gmaven plugin uses groovy version 1.6 as a dependency. In my pom, I specify in the dependency management section the grooyv-all version as : <dependencyManagement> <dependencies> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> <version>1.7-beta-1</version> </dependency> </dependencies> </dependencyManagement> Yet when I run maven in debug mode I see that groovy 1.6 is being used for a dependency to the gmaven plugin. I thought my dependency management section would override this so

Is it best to Mavenize your project jar files or put them in WEB-INF/lib?

久未见 提交于 2019-12-04 05:29:03
问题 I've been doing this for all of the jar files that my Spring MVC project needs: call mvn install:install-file -DgroupId=vegetables -DartifactId=potatoes -Dversion=1.0 -Dfile=vegetables-1.0.jar -Dpackaging=jar -DgeneratePom=true Recently I must have exceeded some limit on how many dependencies you can list in your pom.xml file because I got an error that said: Your command line is too long So I removed some dependencies from the pom.xml that my project no longer uses and I was able to run the

How to inject SVN revision number into JAR?

爱⌒轻易说出口 提交于 2019-12-04 05:08:47
I want my JAR/WAR application to know what is the SVN revision number of its source code. I want this revision number to be later rendered for web end-users at the bottom of a web page, etc. Is there any existing Maven plugin to automate the process? I think that the plugin has to collect the information from svn and save to some file, like src/resources/revision.txt . This page provides the answer to an almost identical problem: Maven CookBook: How To Add SVN Revision To A JAR Manifest? In your case, instead of building a manifest entry, you need to use the buildNumber variable for resource