Java Code Examples for org.apache.maven.project.MavenProject#setPackaging()

The following examples show how to use org.apache.maven.project.MavenProject#setPackaging() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NbMavenProjectImpl.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public void run() {
    problemReporter.clearReports(); //#167741 -this will trigger node refresh?
    MavenProject prj = loadOriginalMavenProject(true);
    synchronized (NbMavenProjectImpl.this) {
        MavenProject old = project == null ? null : project.get();
        if (old != null && MavenProjectCache.isFallbackproject(prj)) {
            prj.setPackaging(old.getPackaging()); //#229366 preserve packaging for broken projects to avoid changing lookup.
        }
        project = new SoftReference<MavenProject>(prj);
        if (hardReferencingMavenProject) {
            hardRefProject = prj;
        }
    }
    ACCESSOR.doFireReload(watcher);
}
 
Example 2
Source File: MavenProjectCache.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@NbBundle.Messages({
    "LBL_Incomplete_Project_Name=<partially loaded Maven project>",
    "LBL_Incomplete_Project_Desc=Partially loaded Maven project; try building it."
})
public static MavenProject getFallbackProject(File projectFile) throws AssertionError {
    MavenProject newproject = new MavenProject();
    newproject.setGroupId("error");
    newproject.setArtifactId("error");
    newproject.setVersion("0");
    newproject.setPackaging("pom");
    newproject.setName(Bundle.LBL_Incomplete_Project_Name());
    newproject.setDescription(Bundle.LBL_Incomplete_Project_Desc());
    newproject.setFile(projectFile);
    return newproject;
}
 
Example 3
Source File: ProjectToStringTest.java    From unleash-maven-plugin with Eclipse Public License 1.0 5 votes vote down vote up
private static MavenProject createProject(String gid, String aid, String version, String packaging) {
  MavenProject p = new MavenProject();
  p.setGroupId(gid);
  p.setArtifactId(aid);
  p.setVersion(version);
  p.setPackaging(packaging);
  return p;
}
 
Example 4
Source File: ProjectToCoordinatesTest.java    From unleash-maven-plugin with Eclipse Public License 1.0 5 votes vote down vote up
private static MavenProject createProject(String gid, String aid, String version, String packaging) {
  MavenProject p = new MavenProject();
  p.setGroupId(gid);
  p.setArtifactId(aid);
  p.setVersion(version);
  p.setPackaging(packaging);
  return p;
}