build-process

How do I put all required JAR files in a library folder inside the final JAR file with Maven?

假装没事ソ 提交于 2019-11-26 04:36:57
问题 I am using Maven in my standalone application, and I want to package all the dependencies in my JAR file inside a library folder, as mentioned in one of the answers here: How can I create an executable JAR with dependencies using Maven? I want my final JAR file to have a library folder that contains the dependencies as JAR files, not like what the maven-shade-plugin that puts the dependencies in the form of folders like the Maven hierarchy in the .m2 folder. Well, actually the current

The benefits / disadvantages of unity builds? [duplicate]

核能气质少年 提交于 2019-11-26 04:26:25
问题 This question already has an answer here: #include all .cpp files into a single compilation unit? 6 answers Since starting at a new company I\'ve noticed that they use unity cpp files for the majority of our solution, and I was wondering if anyone is able to give me a definitive reason as to why and how these speed up the build process? I would\'ve thought that editing one cpp file in the unity files will force recompilation of all of them. 回答1: Very similar question and good answers here:

Ant: How to execute a command for each file in directory?

假如想象 提交于 2019-11-26 03:51:40
问题 I want to execute a command from an Ant buildfile, for each file in a directory. I am looking for a platform-independent solution. How do I do this? Sure, I could write a script in some scripting language, but this would add further dependencies to the project. 回答1: Short Answer Use <foreach> with a nested <FileSet> Foreach requires ant-contrib. Updated Example for recent ant-contrib: <target name="foo"> <foreach target="bar" param="theFile"> <fileset dir="${server.src}" casesensitive="yes">

How to run Visual Studio post-build events for debug build only

跟風遠走 提交于 2019-11-26 02:59:41
问题 How can I limit my post-build events to running only for one type of build? I\'m using the events to copy DLLs to a local IIS virtual directory but I don\'t want this happening on the build server in release mode. 回答1: Pre- and Post-Build Events run as a batch script. You can do a conditional statement on $(ConfigurationName) . For instance if $(ConfigurationName) == Debug xcopy something somewhere 回答2: FYI, you do not need to use goto. the shell IF command can be used with round brackets: if

Is it possible to create an “uber” jar containing the project classes and the project dependencies as jars with a custom manifest file?

孤者浪人 提交于 2019-11-26 02:33:35
问题 I\'m trying to create a executable jar(using maven) that contains the project classes and it\'s dependencies with a manifest file that has the entry for the main class and the class path entry that points to the dependencies packed in the root of the jar;something like this : Manifest File: ..... Main-Class : com.acme.MainClass Class-Path : dependecy1.jar dependecy2.jar ..... Jar: jar-root |-- .... |-- com/acme/../*.class |-- dependecy1.jar `-- dependecy2.jar I\'m using the maven-jar-plugin

Building executable jar with maven?

为君一笑 提交于 2019-11-26 02:26:30
问题 I am trying to generate an executable jar for a small home project called \"logmanager\" using maven, just like this: How can I create an executable JAR with dependencies using Maven? I added the snippet shown there to the pom.xml, and ran mvn assembly:assembly. It generates two jar files in logmanager/target: logmanager-0.1.0.jar, and logmanager-0.1.0-jar-with-dependencies.jar. I get an error when I double-click on the first jar: Could not find the main class: com.gorkwobble.logmanager

Maven parent pom vs modules pom

淺唱寂寞╮ 提交于 2019-11-26 02:26:10
问题 There seem to be several ways to structure parent poms in a multiproject build and I wondering if anyone had any thoughts on what the advantages / drawbacks are in each way. The simplest method of having a parent pom would be putting it in the root of a project i.e. myproject/ myproject-core/ myproject-api/ myproject-app/ pom.xml where the pom.xml is both the parent project as well as describes the -core -api and -app modules The next method is to separate out the parent into its own

#include all .cpp files into a single compilation unit?

妖精的绣舞 提交于 2019-11-26 01:58:30
问题 I recently had cause to work with some Visual Studio C++ projects with the usual Debug and Release configurations, but also \'Release All\' and \'Debug All\', which I had never seen before. It turns out the author of the projects has a single ALL.cpp which #includes all other .cpp files. The *All configurations just build this one ALL.cpp file. It is of course excluded from the regular configurations, and regular configurations don\'t build ALL.cpp I just wondered if this was a common

Maven Modules + Building a Single Specific Module

帅比萌擦擦* 提交于 2019-11-26 01:48:10
问题 I have a multi-module Maven project with a parent project P and three sub-modules A , B , and C . Both B and C are war projects and both depend on A . I can type mvn compile in P and have all of the sub-modules properly compiled. The problem comes when I want to do operations for specific modules. I\'d like to be able to package a war for project B , but when I run the package command from B \'s directory, it complains that it can\'t find the dependencies for A . I understand from this

Best practices for copying files with Maven

北战南征 提交于 2019-11-26 01:34:22
问题 I have config files and various documents that I want to copy from the dev environment to the dev-server directory using Maven2. Strangely, Maven does not seem strong at this task. Some of the options: Simple use a copy task in Maven <copy file=\"src/main/resources/config.properties\" tofile=\"${project.server.config}/config.properties\"/> Use the Ant plugin to execute copy from Ant. Construct an artifact of type zip , alongside the \"main\" artifact of the POM which is usually of type jar ,