maven-2

Maven: use dependencies from repository when running command line app?

醉酒当歌 提交于 2019-12-10 17:47:37
问题 I've used Maven to build my command line application. Now I'm going to distribute it as a jar file, and I need to handle the app's dependencies. I don't want to include all dependencies in the jar file as described here. The environment where my app will be run has Maven. I'd like Maven to run my jar looking at file META-INF/groupId/artifactId/pom.xml inside the package so it knows what the dependencies are and can find them in the repository. Any ideas ? 回答1: Include a main class in the jar

why my schema.ddl is empty after hibernate3-maven-plugin?

喜你入骨 提交于 2019-12-10 17:42:13
问题 This is the directory structure of the project (maven2 is used): pom.xml /src /main /java Abc.java /resources hibernate.cfg.xml database.properties /META-INF persistence.xml /test /java AbcTest.java /resources database.properties This is the content of hibernate.cfg.xml : <hibernate-configuration> <session-factory name="java:hibernate/SessionFactory"> <property name="hibernate.archive.autodetection">true</property> </session-factory> </hibernate-configuration> This is what I have in

Can Nexus/Artifactory store a copy of an internet Maven artifact?

自古美人都是妖i 提交于 2019-12-10 17:32:51
问题 I would like to have Nexus (or Artifactory, we're not decided yet) store a copy of an artifact when it is downloaded from a public repository on the internet (like Maven Central). Basically, if you don't have the jar in your local repo and the repo manager doesn't have it either, I want to ask the repo manager for the jar, have it send it to me, and store it both in the repo manager and in my local repo. Then, when another person asks the repo manager for the same jar, it sends it to them

Disable Maven SCM

廉价感情. 提交于 2019-12-10 17:15:36
问题 Could I disable SCM integration option in Maven? I want it to build a local checked-out project without SCM integration ? is there some settings or some how?? thanx in advance 回答1: SCM integration is only used when you want to release a new version of software or generate changelog. When build a local checked-out project SCM integration is "ignored". There is also scm-plugin but it isn't binded to none of the default lifecycles. EDIT According pom reference if you declare scm section it must

Preserving argument spacing, etc when passing into mvn exec:java

纵饮孤独 提交于 2019-12-10 17:11:05
问题 I have a shell script that launches a Maven exec:java process - exec mvn exec:java -Dexec.mainClass=... -Dexec.args="$*" Now sadly if I run ./myMagicShellScript arg1 "arg 2" the single string arg 2 doesn't make it through as a single argument as I'd like. Any thoughts as to how to escape / pass things through properly (perferably in a clean way)? 回答1: I took a look at the mvn script and did some testing. This is what I came up with: Try changing your script to look like this: args=(${@// /\\

Debugging maven junit tests with filtered resources?

折月煮酒 提交于 2019-12-10 17:04:01
问题 We are using filtered testResources in JUnit-tests that are usually executed by the maven surefire plugin. That is, the pom contains a section <build> <testResources> <testResource> <directory>src/test/resources</directory> <filtering>true</filtering> </testResource> </testResources> ... How can I run such JUnit-tests in the debugger? If I execute the tests in eclipse the tests fail since the test resources are not filtered. If the filtered test resources would be written somewhere into the

Why is axistools-maven-plugin trying to access this relative schema location?

纵然是瞬间 提交于 2019-12-10 16:58:26
问题 We're doing a web service project with Axis 1.x and I'm having problems getting the Maven build to work. I do a mvn clean generate-sources which triggers axistools-maven-plugin's wsdl2java goal. It eventually aborts with [INFO] [axistools:wsdl2java {execution: generate-project}] [INFO] about to add compile source root [INFO] Processing wsdl: C:\Project\src\main\webapp\WEB-INF\wsdl\project.wsdl Jan 24, 2011 11:24:58 AM org.apache.axis.utils.JavaUtils isAttachmentSupported WARNING: Unable to

Maven dependency versioning and java.lang.NoClassDefFoundError

喜你入骨 提交于 2019-12-10 16:28:07
问题 I have a Java project X has dependency (in pom file) on project Y. I was modifying in Y and build X,Y with Maven tool then runing X (on JBoss) without problems. When I added new class in Y then building with Maven (without problems), then running X, it throws java.lang.NoClassDefFoundError for the new class. I think its a Maven dependency versioning or something like that ... I searched mainly at Google but nothing has effect... How to resolve this problem?? 回答1: Moro, you wrote in a comment

maven2 - how to list all resources repository url from pom file

╄→尐↘猪︶ㄣ 提交于 2019-12-10 15:59:06
问题 I'm looking for something like this: List<URL> urls = listURLFromPOM("c:\pom.xml"); .. http://repo1.maven.org/maven2/org/apache/ibatis/ibatis-core/3.0/ibatis-core-3.0.jar http://repo1.maven.org/maven2/org/apache/camel/camel-activemq/1.1.0/camel-activemq-1.1.0.jar ... 回答1: You can use the Maven Dependency Plugin to analyze the dependencies of you POM. mvn dependency:list -DoutputAbsoluteArtifactFilename=true -DoutputFile=dependencies.txt 回答2: A dependency is not aware of its "source repository

How to generate Java from an XSD using MOXy under Maven-3?

早过忘川 提交于 2019-12-10 15:49:06
问题 What's the easiest/best way to generate Java from an XSD using MOXy under Maven-3? The reference JAXB interface has a nice Maven plugin, but it doesn't appear to support MOXy. Does anyone have anything concrete to offer? (I know I can write ant-script, or a plugin, or ...) 回答1: EclipseLink MOXy, does not yet offer a Maven plugin to run the XML schema to Java compiler. I have entered the following enhancement request to track this functionality: https://bugs.eclipse.org/346486 MOXy leverages