-
Notifications
You must be signed in to change notification settings - Fork 332
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
Cannot update internal parent resolvable through company mirror #4589
Comments
Hi @natalia-pokrovskaya ; thanks for the detailed report. Since it looks to be an internal parent that can not be upgraded I'm wondering if your repositories are configured correctly. Does it work when you try to change the parent pom from one that's available in Maven Central? |
I created a very simple project (don't blame me, blame the chatbot for the bad code :p): structure:
_pom.xml:_```xml 4.0.0
_my-module/pom.xml:_```xml 4.0.0
Step 1: see that it compiles (✅) _Adjusted pom.xml:_(See bottom for build plugin -- literally taken from @natalia-pokrovskaya 's example above) <!--
~ Copyright [Year] [Your Name]
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId>
<version>33</version>
</parent>
<groupId>com.example</groupId>
<artifactId>my-parent-project</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>My Parent Project</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>my-module</module>
</modules>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>5.42.2</version>
<configuration>
<configLocation>rules.yml</configLocation>
<activeRecipes>
<recipe>my.test.UpgradeParent</recipe>
</activeRecipes>
<failOnInvalidActiveRecipes>true</failOnInvalidActiveRecipes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project> Step 2b: Add my-module/rules.yml [strange location -- not the root, but the last project executed!!!!]: _rules.yml:_```yaml type: specs.openrewrite.org/v1beta/recipe name: my.test.UpgradeParent displayName: Change Maven dependency example recipeList: - org.openrewrite.maven.ChangeParentPom: oldGroupId: org.apache.maven oldArtifactId: maven-parent newVersion: 34 ``` Step 3: run it (
But that would mean that the openrewrite plugin is not very useful for any project which is not on the central maven repository? I verified that it doesn't work against an internal parent pom. |
hi @svaningelgem ; thanks for reporducing. I imagine you're a colleague of @natalia-pokrovskaya and as such are using much of the same settings? OpenRewrite definitely does work for internal projects as well, but perhaps there's an issue with the specific configuration that you're using. Whenever possible we try to use |
You've guessed correct @timtebeek 👍 . I have an So, nothing out of the ordinary there (I think)... |
hi @timtebeek, thank you very much for the reply! yes, we are using our internal next to proxy everything. in my settings.xml I have:
but when checking for logs, I have no impression openrewrite check our custom repositories.... Thank you in advance for your help! best regards, |
In my settings file I simply have this: <settings>
<servers>
<server>
<id>Maven_Public</id>
<username>%my username%</username>
<password>%pass%</password>
</server>
</servers>
<mirrors>
<mirror>
<id>Maven_Public</id>
<mirrorOf>*</mirrorOf>
<url>%our nexus url%</url>
</mirror>
</mirrors>
</settings> So, a lot less than @natalia-pokrovskaya . But indeed, it looks to be bypassing our local nexus server in favor of an external one? |
I have same issue,when ChangeParentPom with local mirror server . |
Hello,
I have an issue running custom recipie for
org.openrewrite.maven.ChangeParentPom
Here is my configuration:
A maven, multi-module project. I want to update the version of the parent of the root's pom.xml file.
Here is my configuration in rules.yml file:
In my pom.xml I have:
But when I run it with rewrite:run or rewrite:dryRun, it doesn't match my parent pom GAV and don't update it...
I tried to specify newArtifactId, newGroupId, but it changes nothing.... What am I doing wrong?
Any help will be highly appreciated...
Thank you very much in advance!
I am using:
The text was updated successfully, but these errors were encountered: