property « Development « Maven/Ant Q&A

Home
Maven/Ant Q&A
1.Ant
2.artifact
3.dependency
4.deploy
5.Development
6.eclipse
7.glassfish
8.hudson
9.integration
10.jetty
11.junit
12.m2eclipse
13.module
14.netbeans
15.package
16.plugin
17.POM
18.repository
19.svn
Maven/Ant Q&A » Development » property 

1. How do I get maven to "stamp" a build number into a properties file    stackoverflow.com

I would like to be able to, as part of a maven build, set the build number (doesn't matter exactly what) in a properties file/class (so I can show it in ...

2. Can I force Maven 2 to require a property to be specified on the command line?    stackoverflow.com

I'm setting up a maven build, and the destination server needs to be specified on the command line as a property (which is then used to select the appropriate profile), eg

mvn ...

3. How to read an external properties file in Maven     stackoverflow.com

Does anyone know how to read a x.properties file in Maven. I know there are ways to use resource filtering to read a properties file and set values from that, but ...

4. Setting default values for custom Maven 2 properties    stackoverflow.com

I have a Maven pom.xml with a plugin that I want to be able to control on the command line. Everything works otherwise fine, except even after searching the net a ...

5. Maven release properties    stackoverflow.com

When we release projects it is usually the same every time. Are there any arguments or properties that I can add to release:prepare that will allow for pattern releasing in batch ...

6. Forcing the user to enter a property using Maven    stackoverflow.com

What I want to do is this: I have a pom.xml that depends on some property that the user will have to type as he calls mvn by an -D property. ...

7. How to share common properties among several maven projects?    stackoverflow.com

I have several projects built by maven, and I want to share some common properties among them - spring version, mysql driver version, svn base url, etc. - so I can ...

8. What is simple way to fail a build when a property is not set?    stackoverflow.com

As stated in the title, how can I modify - in the simplest manner possible - a pom.xml in order to make it fails if a property is not set in ...

9. maven ${user.home} not being resolved correctly    stackoverflow.com

I've got the following line in my pom.xml:

<updateRepositoryURL>file:/${user.home}/.m2/repository/repository.xml</updateRepositoryURL>
and when I am attempting to use it within my program the resultant string is:
file:/c:Documents and Settings<myusername>/.m2/repository/repository.xml
where <myusername> is my user name funnily enough. however ...

10. Assigning one property to another in Maven    stackoverflow.com

My Maven project has two properties which are used when filtering a persistence configuration file:

<database-url>jdbc:mysql://localhost/${database-name}?autoReconnect=true&amp;amp;useUnicode=true&amp;amp;characterEncoding=UTF-8&amp;amp;rewriteBatchedStatements=true&amp;amp;useServerPrepStmts=false&amp;amp;useCursorFetch=true</database-url>
<test-database-url>jdbc:mysql://localhost/${test-database-name}?autoReconnect=true&amp;amp;useUnicode=true&amp;amp;characterEncoding=UTF-8&amp;amp;rewriteBatchedStatements=true&amp;amp;useServerPrepStmts=false&amp;amp;useCursorFetch=true</test-database-url>
The properties need to be doubly-XML-encoded since the configuration file itself is an XML document and Maven ...

11. how to create maven property    stackoverflow.com

How can I create maven property with the classpath as part of it ?

12. Maven: properties not being substituted    stackoverflow.com

I'm using a maven plugin for install4j in my project, located here. That plugin lets you pass variables to install4j using the <compilerVariables> section. Here's the relevant section of ...

13. How to generate enum from properties file in Maven?    stackoverflow.com

The original title was "How to generate enum from properties file using ant?" I want to iterate over all properties and generate enum class that have every property. Im thinking about writing custom task, ...

14. Specify system property to Maven project    stackoverflow.com

Is there a way ( I mean how do I ) set a system property in a maven project? I want to access a property from my test and my webapp ( ...

15. Standard maven layout for a web application, do my .properties files go?    stackoverflow.com

Assuming I have a .properties file and hibernate.cfg.xml in a standard maven web application layout where should they be placed so that they are included in my .war file when I ...

16. Custom properties in Maven based on command line switch    stackoverflow.com

[reduced for simplicity]

  • I have a project with several Maven modules
  • A module has a properties files whose contents are filtered during build
  • There are sets of properties that can be grouped
  • Only one group ...

  • 17. Recursively defining maven properties    stackoverflow.com

    We are attempting to re-factor our modularized maven building. We've introduced a property DEPLOYMENT_ENV which might be "prod", "dev", "staging", or what not. The mentality we had going in ...

    18. Setting velocity properties    stackoverflow.com

    I have occurence building a maven archetype where I want to do something like this

    #set( $controllerPackage = ${package}\.${artifactId})
    
    i.e. set the controllerPackage variable to equal the result of string concatentaion of ...

    19. Define properties in maven depending on other property values    stackoverflow.com

    I want to create a maven project with the following structure:

    A
    |--pom.xml
    |--B
       |--pom.xml
    |--C
       |--pom.xml
    
    where A, B and C are folders, and B's pom.xml and C's pom.xml are children ...

    20. Where is the list of predefined Maven properties    stackoverflow.com

    I know there is a list of all predefined Maven properties (you know like project.build.sourceEncodin). I once saw the list but I just can't find it again.

    21. Modifying the value of a Maven Property when Substituting it    stackoverflow.com

    Is there a way in Maven to convert the value of a property, such as through a simple String.replace() call, before the value is substituted into a file? I have a situtation ...

    22. Problems passing system properties using maven 3.0.1    stackoverflow.com

    I'm using maven 3.0.1 in ubuntu 10.10, I'm trying to do:

    export JAVA_OPTS="-Dfoo=bar"
    mvn clean install
    
    And my build does not work. However, when I do
    mvn clean install -Dfoo=bar
    
    It works. Does anyone have any idea ...

    23. When are properties resolved?    stackoverflow.com

    I defined a profile at my base-pom which uses a property that is defined by a sub-pom (deploy-location of the appserver-module). The profile shall be used after the initial full-build and ...

    24. Maven properties in site apt files    stackoverflow.com

    How can I use maven properties in site APT files? For example I want to use ${project.version} in the index.apt so I can always refer to the latest version without manually ...

    25. How to react on file in path with property in maven?    stackoverflow.com

    I want to use some plugin executions of my maven project only when a certain file does not exist. The path to this file can change - that's why it must ...

    26. How can I use Maven project properties in izpack-maven-plugin install.xml?    stackoverflow.com

    Following http://maksim.sorokin.dk/it/2010/06/10/izpack-with-maven/ I wrote a Maven POM which creates an IzPack installer, using the izpack-maven-plugin. However I found now way to pass plugin configuration parameters such ...

    27. User and project specific settings in Maven    stackoverflow.com

    We develop multiple branches of a project concurrently. Each developer has multiple working copies, each working copy uses its own DB schema. (There will typically be a working copy ...

    28. Read maven.properties file inside jar/war file    stackoverflow.com

    Is there a way to read the content of a file (maven.properties) inside a jar/war file with Java? I need to read the file from disk, when it's not used (in ...

    29. Why does maven not copy the properties files during the build process?    stackoverflow.com

    Nothing I've found has been able to help me solve this one specific case. I recently switched from a plain old java web app project (which was working) to a maven ...

    30. Is it possible to control how Maven handles missing properties?    stackoverflow.com

    I have a Maven build which uses jruby-rake-plugin for certain executions. Sometimes, when I run this build, I set a Java system property; other times I do not. I need to ...

    31. per-user Maven properties    stackoverflow.com

    In my Maven build I would like to be able to define default values (e.g. for database connection) in pom.xml, but I would like the user to be able to override ...

    32. Maven Properties not referenced in properties file    stackoverflow.com

    I have some properties in my maven pom.xml.

    <properties>
        <number>3</number>
        <age>38</age>
    </properties>
    
    (They are random properties) In a properties file, lets call it resource.properties, I have the following:
    value1 = ...

    33. How to modify default properties in Maven extension    stackoverflow.com

    I want to write a maven plugin (extension) which implements lifecycles for javascript projects so projects with a pom.xml like this can be compiled:

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org
      <modelVersion>4.0.0</modelVersion>
    
      ...

    34. Setting the object type of a Maven property    stackoverflow.com

    How can set the object type of a property in a pom file? I'm working with DBUnit to do DB exports and I'm trying to pass in the table parameter

       ...

    35. Nested Maven macro variables problem    stackoverflow.com

    In Maven POM I want to implement Resource filter
    Consider following property file

    1. env=local

    2. local_user=scott
    3. remote_user=tiger

    4. database_user=${${env}_user}
    Is it possible to have nested maven macros as indicated line no 6
    Regards
    Rajul Konkar

    36. Processing Maven properties    stackoverflow.com

    Sorry for a newbie question. I've a jar file that contains maven archetype. It goes with a bunch of java/resource files all of which having the following lines at the top

    #set( ...

    37. Maven property current user name?    stackoverflow.com

    Is there any maven property to get the user name of the user that runs maven (windows and linux)?

    38. Accessing Project Properties from settings.xml    stackoverflow.com

    I'm trying to activate a profile in my settings.xml by the value of the pom's groupId. To achieve that I have:

    <settings>
        <profiles>
          ...

    39. How to use properties from a property file within a Maven script?    stackoverflow.com

    I want to use properties that are defined in a property file in a Maven script, in a plugin configuration section. How can I do that? Extract from my Maven script:

    ...
    <configuration>
      ...

    40. Maven properties in multi-module project are reset to default    stackoverflow.com

    I have a question regarding properties in a multi-module project. Consider the following 3-level project struture:

    project
    +- pom.xml (packaging: pom)        //referred to as super-pom
    +- module_group
      ...

    41. Maven not picking up property defined in settings.xml in .m2    stackoverflow.com

    I have defined the property like so:

    <profile>
    <id>dand</id>
    <properties>
    <workSpace>s:/_java/</workSpace>
    </properties>
    ...repos
    </profile>
    
    <activeProfiles>
    <activeProfile>dand</activeProfile>
    </activeProfiles>
    
    I am attempting to access the property with
    <outputDir>${workSpace}/src/main/java</outputDir>
    

    42. I can't get maven to use properties defined in ~/.m2/settings.xml?    stackoverflow.com

    I am using ~/.m2/settings.xml to store a number of property names used throughout the pom.xml files in my project. If I make the XML invalid (by adding another < for example), ...

    43. How to identify and set a missing environment property in Maven?    stackoverflow.com

    I have my build set-up so that I pass in my variable via the command line:

    mvn clean install -DsomeVariable=data
    
    In my pom I have:
    <someTag>${someVariable}</someTag>
    
    This works fine, but I would like to identify ...

    java2s.com  | Contact Us | Privacy Policy
    Copyright 2009 - 12 Demo Source and Support. All rights reserved.
    All other trademarks are property of their respective owners.