V
V
vbNoName2018-08-03 22:46:00
Java
vbNoName, 2018-08-03 22:46:00

Why doesn't maven create properties?

The pom.xml file has this construction

<properties>
            <datasource>jdbc/${project.artifactId}DS</datasource>
</properties>

Then this datasource is used in the setting.properties of the project.
datasourceName=${datasource}
The problem is that in setting.properties this datasource is equal to null every other time. Why is that? something wrong with maven? Although I tried different versions

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill Romanov, 2018-08-03
@Djaler

These properties are for use inside the pom.xml itself, they do not affect setting.properties in any way

M
MaxLich, 2018-08-06
@MaxLich

So:

<properties>
        <jdk.version>1.8</jdk.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>${jdk.version}</source>
                    <target>${jdk.version}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question