Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AC2E4F267 for ; Wed, 27 Mar 2013 11:57:55 +0000 (UTC) Received: (qmail 7648 invoked by uid 500); 27 Mar 2013 11:57:53 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 7221 invoked by uid 500); 27 Mar 2013 11:57:52 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 7209 invoked by uid 99); 27 Mar 2013 11:57:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Mar 2013 11:57:51 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of stephen.alan.connolly@gmail.com designates 74.125.82.180 as permitted sender) Received: from [74.125.82.180] (HELO mail-we0-f180.google.com) (74.125.82.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Mar 2013 11:57:47 +0000 Received: by mail-we0-f180.google.com with SMTP id r5so4516866wey.25 for ; Wed, 27 Mar 2013 04:57:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=5kazwzSRpdsesbgZMkR71EKag8VAccMBTUnF0nrk314=; b=vkd8Sz8xqnay4DDQSkWZ62LnUOLlROI5T3KfnosFAHXBCCfTwV/OFjQSXvBZRuDRnZ zsbZFHN+xXWpTYcQ+r9tJwVyguPfSj5ehaGv83EHdv+TmRMR26++F88g2ZL76GblQnzR mvJVjE4WSdGRSDb+yaVQUSPrTJ15EkDlqGvKQ6+uDdM0rLq0iyTx6/JefACNf6pZq5Qa q8qJCZnx2lyQkDi3eBnLr7L0vWL0SRb6ILuWw/V8ZDtdhi+dkTcAf7odBkVxD9lPUrWU J1GFhmnvy8Xtfe4Y4HzC8EQBziwWoXuZ6CrKf0PWxLyAZmCN7Qtvjxfj/BixxA+VMlAr QKJg== MIME-Version: 1.0 X-Received: by 10.194.93.68 with SMTP id cs4mr30966617wjb.17.1364385445438; Wed, 27 Mar 2013 04:57:25 -0700 (PDT) Received: by 10.194.20.33 with HTTP; Wed, 27 Mar 2013 04:57:25 -0700 (PDT) In-Reply-To: <1364384172985-5752030.post@n5.nabble.com> References: <1364384172985-5752030.post@n5.nabble.com> Date: Wed, 27 Mar 2013 11:57:25 +0000 Message-ID: Subject: Re: Maven compiler plugin for Same src folder for tests and source code From: Stephen Connolly To: Maven Users List Content-Type: multipart/alternative; boundary=047d7b5d8cffcff1eb04d8e6bd1f X-Virus-Checked: Checked by ClamAV on apache.org --047d7b5d8cffcff1eb04d8e6bd1f Content-Type: text/plain; charset=ISO-8859-1 There are a number of options. I am ranking them in the order that IMHO will result in the least number of hacks to Maven. 1. Switch to the Maven way, move the production code to src/main/java/... and the tests to src/test/java/.... 2. Modify the configuration for the Maven compiler plugin so that you set http://maven.apache.org/plugins/maven-compiler-plugin/testCompile-mojo.html#testIncludesto com/unit/test/**.java and set http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#excludesto com/unit/test/**.java Finally you will need to play with http://maven.apache.org/pom.html#Directories to set sourceDirectory and testSourceDirectory to be both ${basedir}/src. If you do all that, then you should be OK, but adding other plugins that don't play well with Maven's actual configuration will force more hacks upon you. 3. Change your test dependencies from test to compile (note that this may subsequently need hacks to get surefire to run the tests, and so the layering of hacks begins) You will probably also need to play with http://maven.apache.org/pom.html#Directoriesto set sourceDirectory and testSourceDirectory to be both ${basedir}/src. If you do all that, then you should be OK, but adding other plugins that don't play well with Maven's actual configuration will force more hacks upon you. The easiest is #1. Eclipse with the m2e plugin will pick up the configuration changes for you. #2 is the next safest, but in the long run will cause you to cry and vent swearwords at Maven (even though it was you that picked option 2) #3 is destined to blow up in your face when you least expect it. On 27 March 2013 11:36, fyzahmd wrote: > Hi All, > > I have a project which has the following structure. > > > Compilation works fine in eclipse. > How can i compile this using maven ?(both test cases and source file).. > > > Thanks and Regards, > Fayaz ahamed > > > > > > > > -- > View this message in context: > http://maven.40175.n5.nabble.com/Maven-compiler-plugin-for-Same-src-folder-for-tests-and-source-code-tp5752030.html > Sent from the Maven - Users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org > For additional commands, e-mail: users-help@maven.apache.org > > --047d7b5d8cffcff1eb04d8e6bd1f--