maven-2

Maven directory structure

只愿长相守 提交于 2019-12-10 02:25:17
问题 I'm new to Maven and I've been reading all morning tutorials (amazing tool). This new Java project I started looking at however doesn't use the default directory structure. Instead of src/main/java for sources it uses something like src/org/myapp . When I run mvn package on the project (where pom.xml is located) I get a message saying that no Sources have been compiled because it's not able to find them (the source path being different). Is there a way to specify your own sources path in

Maven: PL/SQL script with sql-maven-plugin throws error PLS-00103

大城市里の小女人 提交于 2019-12-10 02:09:46
问题 I'm trying to use the sql-maven-plugin to execute a PL/SQL script on an Oracle 11 database. Although the script is valid PL/SQL (as far as I can tell), the execution gives me a PLS-00103 error: The SQL script: (drop_all_tables.sql) BEGIN EXECUTE IMMEDIATE 'DROP TABLE MY_TABLE'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -942 THEN RAISE; END IF; END; And my plugin configuration: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>sql-maven-plugin</artifactId> <version>1.5</version>

How to define conditional properties in maven?

天大地大妈咪最大 提交于 2019-12-10 01:07:55
问题 For instance, I would like to have property Configuration set to ${env:AAA} if there is an environment variable AAA and to some other constant value if there is no such environment variable. How do I do it in maven 2? 回答1: It appears as though you activate a profile conditionally... <profiles> <profile> <activation> <property> <name>environment</name> <value>test</value> </property> </activation> ... </profile> </profiles> The profile will be activate when the environment variable is defined

How to specify a repository for a dependency in Maven

那年仲夏 提交于 2019-12-10 00:34:41
问题 In projects with several dependencies and repositories, the try-and-error approach of Maven for downloading dependencies is a bit cumbersome and slow, so I was wondering if there is any way to set an specific repo for some declared dependencies. For example, I want for bouncycastle to check directly BouncyCastle's Maven repo at http://repo2.maven.org/maven2/org/bouncycastle/ instead of official Maven. 回答1: Not possible. Maven checks the repositories in their declaration order until a given

Can I add jars to maven 2 build classpath without installing them?

这一生的挚爱 提交于 2019-12-10 00:13:06
问题 Maven2 is driving me crazy during the experimentation / quick and dirty mock-up phase of development. I have a pom.xml file that defines the dependencies for the web-app framework I want to use, and I can quickly generate starter projects from that file. However, sometimes I want to link to a 3rd party library that doesn't already have a pom.xml file defined, so rather than create the pom.xml file for the 3rd party lib by hand and install it, and add the dependency to my pom.xml , I would

How to use a maven 1 repository with maven 2?

大城市里の小女人 提交于 2019-12-09 19:05:15
问题 I am having problem building my project (using maven 2) which references some jars from a maven 1 repository. The scenario: My company has a private maven 1 repository that has the following info: <url>http://my-company-maven1-repo/maven-repository<url> It has the layout of: maven-repository |_repository |_ .... |_ .... |_vectorgraphics |_jars |_freehep_swing-2.0.3.jar |_freehep_io-2.0.2.jar What I have tried: 1. Following the guide here: relevant maven official docs My mvn2 pom.xml:

How to compile a single file with maven? [duplicate]

﹥>﹥吖頭↗ 提交于 2019-12-09 17:16:31
问题 This question already has answers here : Compiling only selected files in Maven (4 answers) Closed 4 years ago . I set up a working maven project with mvn archetype:create ... I can compile all the sources with mvn compile but I want to be able to compile also a single file at time. There is a way to ask maven to compile an arbitrary single .java file? Thanks Updates 1: I would specify the single file on the command line. I would choose the file at the moment of the command launch. I wouldn't

Maven 2 project error icon in Eclipse

≯℡__Kan透↙ 提交于 2019-12-09 17:03:01
问题 I have create multi-module maven project in Eclipse IDE (already installed M2Eclipse plugin). There I can build my project successfully. But after build also it shows errors icon in my every module project. What kind of issue it can be? Thank You. 回答1: Without knowing what errors you are seeing I am going to assume that your issue is with eclipse project properties (build path, src directory specification, output classes directory, etc). You tagged m2eclipse plugin, so you should be able to

How to inject SVN revision number into JAR?

我怕爱的太早我们不能终老 提交于 2019-12-09 16:53:25
问题 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 . 回答1: This page provides the answer to an almost identical problem: Maven CookBook: How To Add SVN Revision To A JAR Manifest?

How do I track plugin dependencies in maven2?

試著忘記壹切 提交于 2019-12-09 14:04:18
问题 I am trying to locate an evil plugin that includes a stoneage version of a certain jar file. How do I do that ? 回答1: also, mvn -X will spit out all kinds of info, i believe it includes dependency versions. 回答2: mvn dependency:resolve-plugins gives a list of dependencies for each plugin 回答3: mvn dependency:tree - shows you a tree of all dependencies including transitive dependencies 来源: https://stackoverflow.com/questions/312767/how-do-i-track-plugin-dependencies-in-maven2