maven-2

How does Maven2 know where to find plugins?

廉价感情. 提交于 2019-12-06 05:37:04
问题 I'm using Maven2 and I can't seem to find any plugins in my repository. I'm getting errors like repository metadata for: 'org.apache.maven.plugins' could not be found on repository: myrepo where myrepo is the name of my repository. My question is how does Maven know where to find plugins? There's a reference in my error to metadata, what metadata is expected where and what format must it take? I've not had much luck so far looking for documentation... (I'm not interested in the easy answer to

Maven profiles and install

假装没事ソ 提交于 2019-12-06 05:31:21
If I have Maven builds set up for an app with profiles set up for different environments (say like prod vs. dev, defining different DB settings and stuff like that) the 'install' goal doesn't seem to make sense, as I don't know which environment got installed into my repo - I've just got com.example.myproject:myapp:0.0.1. Have I misunderstood something, or are profiles supposed to be used with other goals? Well, you could use the classifier attribute so that each profile creates a jar with the classifier, i.e. a unique jar for each environment. Here is a code snippet to illustrate this. When

Duplicate file when deploying apk

馋奶兔 提交于 2019-12-06 05:16:27
问题 This problem seems to come up for a few people, but I haven't been able to apply the solution suggested in other threads for one reason or another so... I am trying to build a simple android app with an embedded webserver. The server of choice if jetty. I am using maven to manage dependencies with the maven-android-plugin. I have added jetty-server v8.x as a dependency with the default scope. When I try and deploy my apk to the sandbox I get an error Found duplicate file for APK: about.html

Class file from a external jar not found during maven build? [duplicate]

半世苍凉 提交于 2019-12-06 04:54:30
问题 This question already has answers here : Can I add jars to maven 2 build classpath without installing them? (23 answers) Closed 3 years ago . I have created a runnable jar which i included in my project(Maven Project). But when i tried doing mvn clean package. My build gets failed It gives me an error in one of my class imports stating that the package does not exist(which is present in jar). What i tried: Tried adding the jat in Web App Libraries. Adding the jar as external jar. Adding it in

JSP hot-swap in Maven glassfish embedded plugin

妖精的绣舞 提交于 2019-12-06 04:49:45
问题 I am trying to setup embedded glassfish maven plugin and I succeeded, but I can't make jsp files to be hot-swapped. Here is my config: <plugin> <groupId>org.glassfish</groupId> <artifactId>maven-embedded-glassfish-plugin</artifactId> <version>3.0.1</version> <configuration> <instanceRoot>${project.build.directory}</instanceRoot> <goalPrefix>embedded-glassfish</goalPrefix> <app>target/myapp.war</app> <port>8080</port> <contextRoot>myapp</contextRoot> <autoDelete>true</autoDelete> <

What are the correct group and artifact ids for Java EE 5 and 6 artifacts?

给你一囗甜甜゛ 提交于 2019-12-06 04:36:22
问题 So far we have been manually downloading the jars and deploying to our maven repo with custom group/artifact ids. I would like to avoid that. So my question is What are the correct group and artifact id's for Java EE 5 and 6 artifacts? I'd like to get the names at JSR level (for example I doesn't need the ids for Java EE 6 uber jar but individual apis like jsr 330 etc) Which is the CORRECT repo to get these from? Does Oracle host there in their own repos? My main interest is in the APIs

Inter Project Dependencies in Maven

眉间皱痕 提交于 2019-12-06 04:04:47
问题 I have two maven projects: project-api project-impl project-impl's POM specifies a dependency on project-api. The top level aggregation pom lists modules project-api and project-impl. If I run compile at top level, the dependencies resolves correctly. If I run compile at project-impl, then it can't find dependency project-api. How can I set up maven such that when project-impl compiles, it first compiles and collects its dependencies on other projects? 回答1: you can only do that from the root

How to write a Maven build script to execute Java

自古美人都是妖i 提交于 2019-12-06 04:04:11
问题 How can I execute a Java program during the build, or after the build has just finished? Is it possible to do this directly from pom? mvn exec:java -Dexec.mainClass=org.sonatype.mavenbook.weather.Main EDIT Let's say I want to execute org.eclipse.content.MyClass . How would I needed to write the code? This builds the project but it doesn't execute my class: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.1</version> <executions> <execution>

Maven 2 & Packaging ejb vs jar

梦想与她 提交于 2019-12-06 03:57:06
If i'm working with ejb 3.1, what's the différence between <packaging>jar</packaging> and <packaging>ejb</packaging> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ejb-plugin</artifactId> <version>2.3</version> <configuration> <ejbVersion>3.1</ejbVersion> </configuration> </plugin> As mentioned at http://maven.apache.org/plugins/maven-ejb-plugin/usage.html , "The plugin doesn't do any EJB specific processing during the generation of the jar except for validating the existence of an EJB deployment descriptor if the EJB version is 2.0+ " Since you have ejb 3.1 the ejb

Maven : Missing artifact com.sun:tools:jar:1.6.0 compile time exception in POM.xml [duplicate]

被刻印的时光 ゝ 提交于 2019-12-06 03:52:19
问题 This question already has answers here : JDK tools.jar as maven dependency (8 answers) Closed 5 years ago . I am getting one weird issue and getting a compile time exception in my pom.xml when i am trying to add dependancy for tools. jar displayed as below( Missing artifact com.sun:tools:jar:1.6.0 ) I have set my JAVA_HOME variable as below: JAVA_HOME : C:\Program Files\Java\jdk1.6.0_34 When i hardcode it to the actual path of JDK1.6 i dont find any error as below. <dependency> <groupId>com