From issues-return-160127-apmail-maven-issues-archive=maven.apache.org@maven.apache.org Thu Feb 6 01:46:03 2020 Return-Path: X-Original-To: apmail-maven-issues-archive@minotaur.apache.org Delivered-To: apmail-maven-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id 9900C198C5 for ; Thu, 6 Feb 2020 01:46:03 +0000 (UTC) Received: (qmail 18346 invoked by uid 500); 6 Feb 2020 01:46:03 -0000 Delivered-To: apmail-maven-issues-archive@maven.apache.org Received: (qmail 18205 invoked by uid 500); 6 Feb 2020 01:46:02 -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 18188 invoked by uid 99); 6 Feb 2020 01:46: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 01:46: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 7AD00E0102 for ; Thu, 6 Feb 2020 01:46: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 39C49780738 for ; Thu, 6 Feb 2020 01:46:00 +0000 (UTC) Date: Thu, 6 Feb 2020 01:46: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=3D170311= 86#comment-17031186 ]=20 Hudson commented on MNG-6071: ----------------------------- Build succeeded in Jenkins: Maven TLP =C2=BB maven =C2=BB MNG-5222 #4 See https://builds.apache.org/job/maven-box/job/maven/job/MNG-5222/4/ > 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)