Hello I'm using a configuration file from src/main/resources in my java application. I'm reading it in my Class like this :
new BufferedReader(new FileReader(new File("src/main/resources/config.txt")));
So now I'm building this with maven using mvn assembly:assembly
. Here is the bit for that in my pom.xml :
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<finalName>TestSuite</finalName>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>com.some.package.Test</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
So when I run my app I get this error :
srcmain
esourcesconfig.txt (The system cannot find the path specified)
But when I right click on my assembled jar I can see it inside, anyone knows what I'm doing wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…