Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properties in profile cannot be read by dependencyManagement #244

Open
HelloDhero opened this issue Dec 2, 2021 · 2 comments
Open

properties in profile cannot be read by dependencyManagement #244

HelloDhero opened this issue Dec 2, 2021 · 2 comments

Comments

@HelloDhero
Copy link

HelloDhero commented Dec 2, 2021

No description provided.

@HelloDhero
Copy link
Author

HelloDhero commented Dec 2, 2021

<flattenMode>resolveCiFriendliesOnly</flattenMode>
<maven-plugin-flatten.version>1.2.7</maven-plugin-flatten.version>
<dependencyManagement>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring-boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>
</dependencyManagement>




<profile>
    <id>springboot_v2.6</id>
    <activation>
        <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
        <java.version>8</java.version>
        <spring-boot.version>2.6.1</spring-boot.version>
    </properties>
</profile>

@chiston
Copy link

chiston commented Feb 16, 2022

Faced the same issue.

<profile>
            <id>win.x86</id>
            <activation>
                <os>
                    <arch>x86</arch>
                    <family>windows</family>
                </os>
            </activation>
            <properties>
                <binaries-name>bin-win32</binaries-name>
                <package-type>zip</package-type>
                <build-os>windows</build-os>
                <build-arch>x86</build-arch>
            </properties>
</profile>

<dependency>
            <groupId>com.myproject</groupId>
            <artifactId>${binaries-name}</artifactId>
            <version>1.0.0</version>
            <classifier>${build-os}-${build-arch}</classifier>
            <type>${package-type}</type>
</dependency>

[ERROR] Failed to execute goal org.codehaus.mojo:flatten-maven-plugin:1.2.4:flatten (flatten) on project bin: 1 problem was encountered while building the effective model for com.myproject:bin:1.0.0-1
[ERROR] [ERROR] 'dependencies.dependency.artifactId' for com.myproject:${binaries-name}:${package-type}:${build-os}-${build-arch} with value '${binaries-name}' does not match a valid id pattern. @

Profile win.x86 is in list of active profiles according to mvn help:active-profiles

Flatten config is following:

<configuration>
    <updatePomFile>true</updatePomFile>
    <flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>

To get it work I have to call profile manually using mvn -Pwin.x86 clean install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants