3

This is from an open source project where there is nearly no support. Compilation of the project went well. But I cannot test or install because of a particular property file cannot be found. I have search up and down the internet and not able to find any solutions. The organization of the director is a little bit unconventional.

some directories. core/src/main/java/org/mskcc/cbio/portal/util/Config.java.

String props = "portal.properties";
InputStream in = this.getClass().getClassLoader().getResourceAsStream(props);
...

more directoires. src/main/resources/portal.properties.

This last src directory has only one subdirectory main, and the main directory has only one resources subdirectory. The file that could not be found is located here.

I am using java 1.7. Maven 3.0.5 The command I used is mvn install

I must be missing one simple configuration somewhere.

There got to be some who can resolve this easily.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Kemin Zhou
  • 6,264
  • 2
  • 48
  • 56
  • 2
    *"This is from an open source project.."* There are a few of them. Care to narrow it down with a link, to save us going "up and down the internet" looking for it? – Andrew Thompson May 21 '13 at 23:26
  • How is the organization "unconventional"? Looks like a normal Maven project to me with the limited information provided, and with a successful Maven build, "portal.properties" will be where it should be. Perhaps you should check the final jar for it. – Dave Newton May 22 '13 at 00:06

1 Answers1

1

src/main/resources is, by default, the path of Aplication/Library resources in Maven. But, you can optionally force this in the pom.xml.

1) Add in the pom.xml

<resource>
   <directory>src/main/resources</directory>
   <filtering>true</filtering>
</resource>

2) run maven -> mvn clean install

3) Search for portal.properties at the build generated at "target" folder. Assert that portal.properties is in the root of the artifact classpath (root of .jar, .ear or /classes in .war).

Michael Henrique
  • 235
  • 1
  • 2
  • 10