From issues-return-160134-archive-asf-public=cust-asf.ponee.io@maven.apache.org Thu Feb 6 02:54:04 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id C255C18061A for ; Thu, 6 Feb 2020 03:54:03 +0100 (CET) Received: (qmail 86906 invoked by uid 500); 6 Feb 2020 02:54:03 -0000 Mailing-List: contact issues-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list issues@maven.apache.org Received: (qmail 86894 invoked by uid 99); 6 Feb 2020 02:54:02 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Feb 2020 02:54:02 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E86A8E3151 for ; Thu, 6 Feb 2020 02:54:01 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 5780F780738 for ; Thu, 6 Feb 2020 02:54:00 +0000 (UTC) Date: Thu, 6 Feb 2020 02:54:00 +0000 (UTC) From: "Hudson (Jira)" To: issues@maven.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MNG-6071) GetResource ('/) returns 'null' if build is started with -f MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MNG-6071?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D170312= 16#comment-17031216 ]=20 Hudson commented on MNG-6071: ----------------------------- Build succeeded in Jenkins: Maven TLP =C2=BB maven =C2=BB MNG-6169/MNG-6553= #28 See https://builds.apache.org/job/maven-box/job/maven/job/MNG-6169%252FMNG-= 6553/28/ > GetResource ('/) returns 'null' if build is started with -f > ----------------------------------------------------------- > > Key: MNG-6071 > URL: https://issues.apache.org/jira/browse/MNG-6071 > Project: Maven > Issue Type: Bug > Affects Versions: 3.2.1, 3.3.1, 3.3.9 > Environment: Windows 10 x64 > Tested in cmd.exe, git bash. > Reporter: Alexander Bender > Assignee: Sylwester Lachiewicz > Priority: Minor > Fix For: 3.7.0 > > Time Spent: 10m > Remaining Estimate: 0h > > I set up a very simple test maven project with only a dependency to testN= G. > {code} > public class TestTest { > @Test > public void test() { > System.out.println(getClass().getResource("/")); > {code} > Depending on how I build this, the call either returns null or the expect= ed directory. How is that? > {code} > // Prints: file:/C:/workspace/test/testproject/target/test-classes/ > mvn clean test -Dtest=3DTestTest -f pom.xml > // Prints: file:/C:/workspace/test/testproject/target/test-classes/ > mvn clean test -Dtest=3DTestTest -f testproject/pom.xml > // Prints: null > mvn clean test -Dtest=3DTestTest -f ./pom.xml > // Prints: null > mvn clean test -Dtest=3DTestTest -f ./testproject/pom.xml > {code} > Note that the second call includes "./" after -f. > I actually want to find out the /target folder regardless of scenario (te= stNG in IntelliJ, Maven, Jenkins Buid, ...). So far, this way has proven th= e most reliable. > {code} > System.out.println(getClass().getResource("./")); > {code} > This seems to reliably point to file:/C:/workspace/test/testproject/targe= t/test-classes/com/testproject/test. Would this be safer to use? -- This message was sent by Atlassian Jira (v8.3.4#803005)