Skip to content
Advertisement

How to configure Maven shade plugin in a multi-module project?

I have been trying to get jar using Maven Shade Plugin, but I still don’t get a success. This is my project structure: Module1 (pom.xml): Module2 (pom.xml): MainModule (pom.xml): According this code I get 2 jar-files (Module1-version.jar and Module2-version.jar). But it is not what I want. I wish to get 1 jar file (MainModule-version.jar), which would contain the other (Module1

IntelliJ IDEA 13 uses Java 1.5 despite setting to 1.7

Despite specifying JDK 1.7 in all project settings (including in File -> Project Structure -> Project :: Project SDK), the following error is produced by IntelliJ 13 when trying to compile some simple Java 7 code which does use the diamond operator: Is there any other place in the configuration where the expected -source 7 option should be enabled? Answer

Abstract class extends concrete class

I earlier learned that abstract class can extend concrete class. Though I don’t see the reason for it from JAVA designers, but it is ok. I also learned that abstract class that extends concrete class can make overriden methods abstract. Why? Can you provide with use case where it is useful? I am trying to learn design patterns and I

Apache POI – setting left/right print margin in Excel

Is that possible – with apache POI – to set left or right print margin for Excel sheet? The default margins are quite big. I cannot see neither setLeftMargin nor setRightMargin in XSSFPrintSetup, but only header and footer: Is there any kind friend that could help me a little? Answer The sheet margins are not contained in the XSSFPrintSetup object,

best ways to dynamically load config in java?

i am designing a web service in java where i need to do a sort of AB testing with requests in java. Basically I’m looking for ways to easily configure parameters which will be dynamically loaded by a request handler to determine the code path based on config values. for example, let’s say i need to get some data either

Calculate average of a huge long array

I’m trying to calculate the average of many (more than 200) long (primitive type) values stored in an array. Usually you add all the numbers and divide it by the number of the values. But this is not possible in this case since there is no primitive datatype in Java capable of holding such a large number, isn’t it? Will

Map Reduce flow in Hadoop

I’m learning Hadoop using the book Hadoop in Practice, and while reading chapter 1 i came across this diagram: From the Hadoop docs:(http://hadoop.apache.org/docs/current2/api/org/apache/hadoop/mapred/Reducer.html) 1.Shuffle Reducer is input the grouped output of a Mapper. In the phase the framework, for each Reducer, fetches the relevant partition of the output of all the Mappers, via HTTP. 2.Sort The framework groups Reducer inputs

Advertisement