Comments (8)
This should be fixed now, in 0.0.8-SNAPSHOT. (You'll need to build it yourself though, it's not deployed anywhere).
I'll do another release once I'm able to merge in your new rules.
from lint-maven-plugin.
I can confirm!
from lint-maven-plugin.
It seems this issue isn't fixed completely, at least when using ${project.version}
and/or ${project.groupId}
:
[INFO] --- lint-maven-plugin:0.0.8:check (validate-pom) @ bulgarian-stemmer ---
WARN [RedundantDependencyVersionsRule:81] 2013-10-28 08:47:47,500 - java.lang.IllegalStateException: Could not resolve Dependency {groupId=${project.groupId}, artifactId=engine, version=null, type=jar} using path dependencies[groupId='${project.groupId}' and artifactId='engine' and type='jar']
WARN [RedundantDependencyVersionsRule:81] 2013-10-28 08:47:47,512 - java.lang.IllegalStateException: Could not resolve Dependency {groupId=${project.groupId}, artifactId=engine, version=${project.version}, type=jar} using path dependencyManagement/dependencies[groupId='${project.groupId}' and artifactId='engine' and type='jar']
from lint-maven-plugin.
Hi,
can you give a sample pom.xml and the complete call, plz
Cheers Lars
from lint-maven-plugin.
Hi Lars,
I tried to find a minimal example. I can reproduce it by running mvn lint:check
on the following POM:
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>com.lewisd</groupId>
<artifactId>example</artifactId>
<version>0.0.8</version>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>lint-maven-plugin</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>lint-maven-plugin</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>${project.groupId}</groupId>
<artifactId>lint-maven-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>validate-pom</id>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<rules>
<excludes>
<exclude>OSS*</exclude>
</excludes>
</rules>
</configuration>
</plugin>
</plugins>
</build>
</project>
from lint-maven-plugin.
Yep, it looks like this isn't completely fixed. I may have to find a completely different approach for the bit of code that's causing this, as I'm not sure the current approach can be fixed.
from lint-maven-plugin.
I'll have a look into this.
from lint-maven-plugin.
Thanks Lars, appreciate it. If you want to discuss any potential solutions, I'd be happy to offer whatever insight I can.
The maven project exposes two models, the "original" model, which maps very closely to the pom.xml, and a resolved model, which has properties replaced (among other things). From what I remember, most rules walk the resolved model, so that they can see the resolved version number, for when the pom.xml has properties in . However, at some point (I don't remember why, at the moment) the plugin has to find the equivalent element in the original element, which is where this is failing.
Maybe the xml file location could be used to more accurately find the original element. Or, maybe it doesn't actually need to find the original element, since I can't remember right now why it was doing that.
from lint-maven-plugin.
Related Issues (20)
- I feel like having non-test scoped <dependencies/> in a pom packaging project is something that could be checked by maven lint HOT 2
- Recommend <type>test-jar</type> over <classifier>tests</classifier>
- RedundantDependencyVersionsRule false positive HOT 5
- NPE while building HOT 10
- Status of this project HOT 11
- create violation for <execution></execution> block without id HOT 4
- Variable vs. literal confusion HOT 2
- The examples in README.md should contain an execution ID HOT 6
- onlyRunRules ignored on master HOT 10
- please connect with travis ci to have automatic PR builds (and more) HOT 2
- add an possibility to collect all violations of a reactor project HOT 1
- Clean up logic and documentation around <rules>, <onlyRunRules>, -Drules
- The 'list' goal has been broken since 0.0.9 HOT 1
- .
- Feature request: Option to warn on multiprojects
- Feature request: Warn on missing test functionality
- Feature request: Block springframework starter artifactIds HOT 2
- NPE in GAVOrder rule HOT 2
- Make it easier to configure which rules are desired HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lint-maven-plugin.