maven-2

Example of a multi-module web application with the rpm-maven-plugin?

点点圈 提交于 2019-12-03 06:53:34
Does anyone know of any web applications that are built with Maven to an RPM? The RPM Maven Plugin provides the functionality to build to an RPM, but it's documentation is lacking. Specifically, I'm looking for an example that would include multiple modules, i.e. Chapter 8. A Multi-module Project , from the "Maven by Example" series. An example with only a single module would be: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4

How can I run a Maven webapp in Eclipse when I use profiles to populate properties files at build time?

十年热恋 提交于 2019-12-03 06:53:07
问题 Here is an example profile in my POM: <profiles> <profile> <id>QA</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <jdbc.url>jdbc:mysql://127.0.0.1:3306/SomeDB</jdbc.url> <jdbc.username>webapp</jdbc.username> <jdbc.password>somepassword</jdbc.password> </properties> </profile> ... I then have a properties file in my resources folder like this: jdbc.url = ${jdbc.url} jdbc.username = ${jdbc.username} jdbc.password = ${jdbc.password} and finally I turn

Accessing an Artifactory/Maven Repo that requires basic-auth

跟風遠走 提交于 2019-12-03 06:51:31
问题 I have an Artifactory repo that sits behind basic authentication. How would I configure the settings.xml to allow access? <mirrors> <mirror> <id>artifactory</id> <mirrorOf>*</mirrorOf> <url>https://myserver.example.com/artifactory/repo</url> <name>Artifactory</name> </mirror> </mirrors> <servers> <!-- This server configuration gives your personal username/password for artifactory. Note that the server id must match that given in the mirrors section. --> <server> <id>Artifactory</id> <username

Having Maven2 copy resources to the build directory, but NOT bundle them in the JAR

怎甘沉沦 提交于 2019-12-03 06:49:37
I've started a new Maven project in NetBeans, accepting all the defaults. The POM, with all the JAR dependencies stripped out, is cut-n-pasted at the bottom of this question. The application reads in various properties files (e.g. logging and config). It also reads in external resources such as fonts, images, and sounds. I do NOT want all these resources to be bundled up into the JAR file. Instead, I plan to deploy them in subdirectories beneath the directory where the JAR is deployed. A simplified view of the project's directory structure looks like this: -src |---main |---java |---com

Is there any free online maven repository?

↘锁芯ラ 提交于 2019-12-03 06:48:10
问题 Is there any free online private maven2 or maven3 repository? So that team can access the repository from various region. 回答1: If you use github, you could use a private github project as your maven repository. There are instruction on how to publish your maven artifacts to github here: https://stackoverflow.com/a/14013645/82156 回答2: we can use dropbox for online maven repository. But it is not completely private. you can use it if it gives you enough privacy. This is the instruction to

How to put maven project version in war file manifest?

ε祈祈猫儿з 提交于 2019-12-03 06:46:08
问题 I need to have Maven insert the version number from the POM file into the manifest located in the WAR file under /WEB-INF/manifest.mf. How do I do this? I was able to easily file documentation for doing this in a JAR file using the maven-jar-plugin, but that does not work on a WAR file. Thanks for the help! 回答1: Figured it out using the maven-war-plugin. See the configuration below: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1.1<

Running resource filters when using jetty:run

眉间皱痕 提交于 2019-12-03 06:39:27
I'm using resource filtering on jsps, based on profiles. I'm also developing locally using mvn jetty:run , but the filtering phase does not run. How can I perform filtering using the jetty plugin? Configuration snippets : <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.0.2</version> <configuration> <webResources> <resource> <directory>src/main/webapp</directory> <includes> <include>error.jsp</include> </includes> <filtering>true</filtering> <targetPath>/</targetPath> </resource> </webResources> </configuration> </plugin> <profile> <id

java.net maven repo - JMS artifact missing

旧巷老猫 提交于 2019-12-03 06:34:46
问题 I just created a new Maven project using the default archetype and added the following dependency to my POM file. <dependencies> <dependency> <groupId>javax.jms</groupId> <artifactId>jms</artifactId> <version>1.1</version> <scope>compile</scope> </dependency> </dependencies> Realizing that the Sun's JARs are not on Maven central due to licensing issues, I added the following Maven repo to my POM (I know this is bad practice though and that it needs to be added to a settings.xml) <repositories

Using maven profiles to control build execution

♀尐吖头ヾ 提交于 2019-12-03 06:22:55
问题 I need to modify the maven build for a large project to skip certain steps during typical development builds (i.e. don't build the *-source.jar files). I've searched for "conditional execution" for maven, but haven't found anything. A dev profile sounds like the intuitive way to do this - but I don't know how intuitive maven is. The docs for profiles show how to set different properties (i.e. database connection parameters) for different profiles. I suppose I could set a property and then

Best location to put your CSS and JS files in a Mavenized Java Web app?

帅比萌擦擦* 提交于 2019-12-03 06:09:48
I have a Web application in maven that follows this structure: src `-- main |-- java |-- resources `-- webapp Is is better to put it in the main folder and then the maven plug in will try to move it or I should put it inside the webapp folder and why? If you don't need to filter CSS and JS files, I would simply put them in src/main/webapp (if you put them in src/main/resources , they will end up in target/classes and in WEB-INF/classes in the WAR which is very unlikely what you want). If you need to filter them, additional resources can be included in the WAR using the webResources parameter.